Merge branch 'Dolibarr:develop' into NEW#22527-view-message
This commit is contained in:
commit
a50b02857a
@ -426,11 +426,9 @@ if ($action == 'create') {
|
|||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Modify').'</a>';
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Modify').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->hasRight('accounting', 'chartofaccount')) {
|
// Delete
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
|
$permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
|
||||||
} else {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -305,7 +305,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
||||||
|
|
||||||
// print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=delete&token='.newToken().'&id=' . $id . '">' . $langs->trans('Delete') . '</a>';
|
//print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -133,7 +133,7 @@ if (empty($user->socid)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->adherent->supprimer) {
|
if ($user->rights->adherent->supprimer) {
|
||||||
echo '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas, 'delete', $user->rights->adherent->supprimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</div><br>';
|
echo '</div><br>';
|
||||||
|
|||||||
@ -65,18 +65,21 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$textobject = $langs->transnoentitiesnoconv("Bank");
|
$help_url = '';
|
||||||
|
$page_name = "BankSetupModule";
|
||||||
|
|
||||||
llxHeader('', $langs->trans("BankSetupModule"), $help_url);
|
llxHeader('', $langs->trans("BankSetupModule"), $help_url);
|
||||||
|
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||||
|
|
||||||
|
|
||||||
$head = bank_admin_prepare_head(null);
|
$head = bank_admin_prepare_head(null);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'attributes', $langs->trans("BankSetupModule"), -1, 'account');
|
print dol_get_fiche_head($head, 'attributes', $langs->trans($page_name), -1, 'account');
|
||||||
|
|
||||||
|
$textobject = $langs->transnoentitiesnoconv("Bank");
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file admin/bankline_extrafields.php
|
* \file htdocs/admin/bankline_extrafields.php
|
||||||
* \ingroup bank
|
* \ingroup bank
|
||||||
* \brief Page to setup extra fields of bankline
|
* \brief Page to setup extra fields of bankline
|
||||||
*/
|
*/
|
||||||
@ -41,7 +41,7 @@ $form = new Form($db);
|
|||||||
|
|
||||||
// List of supported format
|
// List of supported format
|
||||||
$tmptype2label = ExtraFields::$type2label;
|
$tmptype2label = ExtraFields::$type2label;
|
||||||
$type2label = [];
|
$type2label = array();
|
||||||
foreach ($tmptype2label as $key => $val) {
|
foreach ($tmptype2label as $key => $val) {
|
||||||
$type2label[$key] = $langs->transnoentitiesnoconv($val);
|
$type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||||
}
|
}
|
||||||
@ -80,6 +80,8 @@ $head = bank_admin_prepare_head(null);
|
|||||||
|
|
||||||
print dol_get_fiche_head($head, 'bankline_extrafields', $langs->trans($page_name), -1, 'account');
|
print dol_get_fiche_head($head, 'bankline_extrafields', $langs->trans($page_name), -1, 'account');
|
||||||
|
|
||||||
|
$textobject = $langs->transnoentitiesnoconv("BankTransaction");
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|||||||
@ -704,7 +704,7 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&object=bom&token='.newToken().'">'.$langs->trans("ToClone").'</a>'."\n";
|
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=bom', 'clone', $permissiontoadd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close / Cancel
|
// Close / Cancel
|
||||||
@ -726,11 +726,8 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($permissiontodelete) {
|
// Delete
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>'."\n";
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
} else {
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,7 +60,7 @@ function printDropdownBookmarksList()
|
|||||||
if ($sortorder) {
|
if ($sortorder) {
|
||||||
$tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder);
|
$tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder);
|
||||||
}
|
}
|
||||||
if (is_array($_POST)) {
|
if (!empty($_POST) && is_array($_POST)) {
|
||||||
foreach ($_POST as $key => $val) {
|
foreach ($_POST as $key => $val) {
|
||||||
if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var))
|
if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var))
|
||||||
&& $val != ''
|
&& $val != ''
|
||||||
|
|||||||
@ -2933,10 +2933,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
if ($usercandelete) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete);
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'"';
|
|
||||||
print '>'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2899,7 +2899,7 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
// Delete order
|
// Delete order
|
||||||
if ($usercandelete) {
|
if ($usercandelete) {
|
||||||
if ($numshipping == 0) {
|
if ($numshipping == 0) {
|
||||||
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
|
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
|
||||||
} else {
|
} else {
|
||||||
print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -492,11 +492,8 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->deplacement->supprimer) {
|
$permissiontodelete = $user->rights->deplacement->supprimer;
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$id.'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
} else {
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1677,10 +1677,8 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if ($object->statut == Facture::STATUS_DRAFT && $user->rights->facture->supprimer)
|
// Delete
|
||||||
if ($user->rights->facture->supprimer) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->supprimer);
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=ask_deleteinvoice&id='.$object->id.'&token='.newToken().'">'.$langs->trans('Delete').'</a></div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -5744,8 +5744,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteHref, '', $enableDelete, $params);
|
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteHref, '', $enableDelete, $params);
|
||||||
} else {
|
} else {
|
||||||
$params['attr']['title'] = $langs->trans('NotAllowed');
|
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', '', false);
|
||||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', '', false, $params);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -520,13 +520,7 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($user->socid == 0 && $action == '') {
|
if ($user->socid == 0 && $action == '') {
|
||||||
if ($user->rights->facture->paiement) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->paiement && !$disable_delete);
|
||||||
if (!$disable_delete) {
|
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
|
||||||
} else {
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$title_button.'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -82,6 +82,7 @@ $usercanread = $user->rights->banque->cheque;
|
|||||||
$usercancreate = $user->rights->banque->cheque;
|
$usercancreate = $user->rights->banque->cheque;
|
||||||
$usercandelete = $user->rights->banque->cheque;
|
$usercandelete = $user->rights->banque->cheque;
|
||||||
|
|
||||||
|
$permissiontodelete = $user->rights->banque->cheque;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -750,7 +751,7 @@ if ($user->socid == 0 && !empty($object->id) && $object->statut == 0 && $user->r
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($user->socid == 0 && !empty($object->id) && $user->rights->banque->cheque) {
|
if ($user->socid == 0 && !empty($object->id) && $user->rights->banque->cheque) {
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -253,9 +253,9 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
|||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
if ($user->rights->tax->charges->supprimer) {
|
if ($user->rights->tax->charges->supprimer) {
|
||||||
if (!$disable_delete) {
|
if (!$disable_delete) {
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.GETPOST('id', 'int').'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentWithOneInvoicePaid")).'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -308,9 +308,9 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
|||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
if ($user->rights->tax->charges->supprimer) {
|
if ($user->rights->tax->charges->supprimer) {
|
||||||
if (!$disable_delete) {
|
if (!$disable_delete) {
|
||||||
print '<a class="butActionDelete" href="card.php?id='.GETPOST('id', 'int').'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentVATPaid")).'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("CantRemovePaymentVATPaid"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -409,7 +409,6 @@ $dolibarr_cron_allow_cli='0';
|
|||||||
//#################################
|
//#################################
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries instead of embedded one
|
// Value to overwrite path to use shared libraries instead of embedded one
|
||||||
//$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
|
||||||
//$dolibarr_lib_TCPDF_PATH='/usr/share/php/tcpdf';
|
//$dolibarr_lib_TCPDF_PATH='/usr/share/php/tcpdf';
|
||||||
//$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
|
//$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
|
||||||
//$dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf';
|
//$dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf';
|
||||||
|
|||||||
@ -1579,7 +1579,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
if ($user->rights->societe->contact->supprimer) {
|
if ($user->rights->societe->contact->supprimer) {
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().''.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().($backtopage ? '&backtopage='.urlencode($backtopage) : ''), 'delete', $user->rights->societe->contact->supprimer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1222,7 +1222,7 @@ while ($i < min($num, $limit)) {
|
|||||||
if (isModEnabled('socialnetworks')) {
|
if (isModEnabled('socialnetworks')) {
|
||||||
foreach ($socialnetworks as $key => $value) {
|
foreach ($socialnetworks as $key => $value) {
|
||||||
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
|
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
|
||||||
print '<td class="tdoverflowmax100">'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).'</td>';
|
print '<td class="tdoverflowmax100">'.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,6 +97,7 @@ $extralabelslines = $extrafields->fetch_name_optionals_label($object->table_elem
|
|||||||
|
|
||||||
$permissionnote = $user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php
|
||||||
|
$permissiontodelete = ($user->rights->contrat->creer && $object->statut == $object::STATUS_DRAFT) || $user->rights->contrat->supprimer;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -2172,15 +2173,8 @@ if ($action == 'create') {
|
|||||||
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken(), '', true, $params);
|
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken(), '', true, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// On peut supprimer entite si
|
// Delete
|
||||||
// - Droit de creer + mode brouillon (erreur creation)
|
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete, $params);
|
||||||
// - Droit de supprimer
|
|
||||||
if (($user->rights->contrat->creer && $object->statut == $object::STATUS_DRAFT) || $user->rights->contrat->supprimer) {
|
|
||||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', true, $params);
|
|
||||||
} else {
|
|
||||||
$params['attr']['title'] = $langs->trans("NotAllowed");
|
|
||||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', false, $params);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|||||||
@ -4345,7 +4345,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set status of an object
|
* Set status of an object.
|
||||||
*
|
*
|
||||||
* @param int $status Status to set
|
* @param int $status Status to set
|
||||||
* @param int $elementId Id of element to force (use this->id by default if null)
|
* @param int $elementId Id of element to force (use this->id by default if null)
|
||||||
|
|||||||
@ -231,6 +231,8 @@ class FormWebsite
|
|||||||
*/
|
*/
|
||||||
public function selectContainer($website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200', $excludeids = null)
|
public function selectContainer($website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200', $excludeids = null)
|
||||||
{
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
$this->num = 0;
|
$this->num = 0;
|
||||||
|
|
||||||
$atleastonepage = (is_array($website->lines) && count($website->lines) > 0);
|
$atleastonepage = (is_array($website->lines) && count($website->lines) > 0);
|
||||||
@ -239,13 +241,18 @@ class FormWebsite
|
|||||||
if ($atleastonepage && $action != 'editsource') {
|
if ($atleastonepage && $action != 'editsource') {
|
||||||
$out .= '<select name="'.$htmlname.'" id="'.$htmlname.'" class="maxwidth300'.($morecss ? ' '.$morecss : '').'">';
|
$out .= '<select name="'.$htmlname.'" id="'.$htmlname.'" class="maxwidth300'.($morecss ? ' '.$morecss : '').'">';
|
||||||
} else {
|
} else {
|
||||||
$out .= '<select name="pageidbis" id="pageid" class="maxwidth300'.($morecss ? ' '.$morecss : '').'" disabled="disabled">';
|
$out .= '<select name="pageidbis" id="pageid" class="maxwidth300'.($morecss ? ' '.$morecss : '').'"'.($action == 'editsource' ? ' disabled="disabled"' : '').'>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($showempty || !$atleastonepage) {
|
if ($showempty || !$atleastonepage) {
|
||||||
$out .= '<option value="-1"> </option>';
|
$out .= '<option class="optiongrey" value="-1">'.(is_numeric($showempty) ? ' ' : $showempty).'</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
$valueoption = '<span class="classlink">'.img_picto('', 'add', 'class="paddingrightonly"').$langs->trans("AddPage").'</span>';
|
||||||
|
$out .= '<option value="-2" data-html="'.dol_escape_htmltag($valueoption).'">'.$valueoption.'</option>';
|
||||||
|
}*/
|
||||||
|
|
||||||
if ($atleastonepage) {
|
if ($atleastonepage) {
|
||||||
if (empty($pageid) && $action != 'createcontainer') { // Page id is not defined, we try to take one
|
if (empty($pageid) && $action != 'createcontainer') { // Page id is not defined, we try to take one
|
||||||
$firstpageid = 0;
|
$firstpageid = 0;
|
||||||
|
|||||||
@ -644,36 +644,41 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
|||||||
* This is called when MAIN_DIRECT_STATUS_UPDATE is set and it use tha ajax service objectonoff.php
|
* This is called when MAIN_DIRECT_STATUS_UPDATE is set and it use tha ajax service objectonoff.php
|
||||||
*
|
*
|
||||||
* @param Object $object Object to set
|
* @param Object $object Object to set
|
||||||
* @param string $code Name of constant : status or status_buy for product by example
|
* @param string $code Name of property in object : 'status' or 'status_buy' for product by example
|
||||||
* @param string $field Name of database field : 'tosell' or 'tobuy' for product by example
|
* @param string $field Name of database field : 'tosell' or 'tobuy' for product by example
|
||||||
* @param string $text_on Text if on
|
* @param string $text_on Text if on
|
||||||
* @param string $text_off Text if off
|
* @param string $text_off Text if off
|
||||||
* @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid'))
|
* @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid'))
|
||||||
* @param string $morecss More CSS
|
* @param string $morecss More CSS
|
||||||
|
* @param string $htmlname Name of HTML component. Keep '' or use a different value if you need to use this component several time on same page for same property.
|
||||||
* @return string html for button on/off
|
* @return string html for button on/off
|
||||||
*/
|
*/
|
||||||
function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array(), $morecss = '')
|
function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array(), $morecss = '', $htmlname = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
if (empty($htmlname)) {
|
||||||
|
$htmlname = $code;
|
||||||
|
}
|
||||||
|
|
||||||
$out = '<script>
|
$out = '<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
var input = '.json_encode($input).';
|
var input = '.json_encode($input).';
|
||||||
|
|
||||||
// Set constant
|
// Set constant
|
||||||
$("#set_'.$code.'_'.$object->id.'").click(function() {
|
$("#set_'.$htmlname.'_'.$object->id.'").click(function() {
|
||||||
console.log("Click managed by ajax_object_onoff");
|
console.log("Click managed by ajax_object_onoff");
|
||||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", {
|
$.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", {
|
||||||
action: \'set\',
|
action: \'set\',
|
||||||
field: \''.$field.'\',
|
field: \''.dol_escape_js($field).'\',
|
||||||
value: \'1\',
|
value: \'1\',
|
||||||
element: \''.$object->element.'\',
|
element: \''.dol_escape_js($object->element).'\',
|
||||||
id: \''.$object->id.'\',
|
id: \''.$object->id.'\',
|
||||||
token: \''.currentToken().'\'
|
token: \''.currentToken().'\'
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
$("#set_'.$code.'_'.$object->id.'").hide();
|
$("#set_'.$htmlname.'_'.$object->id.'").hide();
|
||||||
$("#del_'.$code.'_'.$object->id.'").show();
|
$("#del_'.$htmlname.'_'.$object->id.'").show();
|
||||||
// Enable another element
|
// Enable another element
|
||||||
if (input.disabled && input.disabled.length > 0) {
|
if (input.disabled && input.disabled.length > 0) {
|
||||||
$.each(input.disabled, function(key,value) {
|
$.each(input.disabled, function(key,value) {
|
||||||
@ -693,19 +698,19 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input =
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Del constant
|
// Del constant
|
||||||
$("#del_'.$code.'_'.$object->id.'").click(function() {
|
$("#del_'.$htmlname.'_'.$object->id.'").click(function() {
|
||||||
console.log("Click managed by ajax_object_onoff");
|
console.log("Click managed by ajax_object_onoff");
|
||||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", {
|
$.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", {
|
||||||
action: \'set\',
|
action: \'set\',
|
||||||
field: \''.$field.'\',
|
field: \''.dol_escape_js($field).'\',
|
||||||
value: \'0\',
|
value: \'0\',
|
||||||
element: \''.$object->element.'\',
|
element: \''.dol_escape_js($object->element).'\',
|
||||||
id: \''.$object->id.'\',
|
id: \''.$object->id.'\',
|
||||||
token: \''.currentToken().'\'
|
token: \''.currentToken().'\'
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
$("#del_'.$code.'_'.$object->id.'").hide();
|
$("#del_'.$htmlname.'_'.$object->id.'").hide();
|
||||||
$("#set_'.$code.'_'.$object->id.'").show();
|
$("#set_'.$htmlname.'_'.$object->id.'").show();
|
||||||
// Disable another element
|
// Disable another element
|
||||||
if (input.disabled && input.disabled.length > 0) {
|
if (input.disabled && input.disabled.length > 0) {
|
||||||
$.each(input.disabled, function(key,value) {
|
$.each(input.disabled, function(key,value) {
|
||||||
@ -725,8 +730,8 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input =
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
$out .= '<span id="set_'.$code.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? 'hideobject' : '').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_off), 'switch_off').'</span>';
|
$out .= '<span id="set_'.$htmlname.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? 'hideobject' : '').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_off), 'switch_off').'</span>';
|
||||||
$out .= '<span id="del_'.$code.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? '' : 'hideobject').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_on), 'switch_on').'</span>';
|
$out .= '<span id="del_'.$htmlname.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? '' : 'hideobject').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_on), 'switch_on').'</span>';
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,12 +153,12 @@ function bank_admin_prepare_head($object)
|
|||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin');
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFields");
|
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')';
|
||||||
$head[$h][2] = 'attributes';
|
$head[$h][2] = 'attributes';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("BanklineExtraFields");
|
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')';
|
||||||
$head[$h][2] = 'bankline_extrafields';
|
$head[$h][2] = 'bankline_extrafields';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||||
@ -2535,8 +2535,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
if ($tzoutput == 'tzserver') {
|
if ($tzoutput == 'tzserver') {
|
||||||
$to_gmt = false;
|
$to_gmt = false;
|
||||||
$offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion'
|
$offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion'
|
||||||
$offsettz = 0; // Timezone offset with server timezone, so 0
|
$offsettz = 0; // Timezone offset with server timezone (because to_gmt is false), so 0
|
||||||
$offsetdst = 0; // Dst offset with server timezone, so 0
|
$offsetdst = 0; // Dst offset with server timezone (because to_gmt is false), so 0
|
||||||
} elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') {
|
} elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') {
|
||||||
$to_gmt = true;
|
$to_gmt = true;
|
||||||
$offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion'
|
$offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion'
|
||||||
@ -2546,8 +2546,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
$user_dt = new DateTime();
|
$user_dt = new DateTime();
|
||||||
$user_dt->setTimezone($user_date_tz);
|
$user_dt->setTimezone($user_date_tz);
|
||||||
$user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : (int) $time);
|
$user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : (int) $time);
|
||||||
$offsettz = $user_dt->getOffset();
|
$offsettz = $user_dt->getOffset(); // should include dst ?
|
||||||
} else { // old method (The 'tzuser' was processed like the 'tzuserrel')
|
} else { // with old method (The 'tzuser' was processed like the 'tzuserrel')
|
||||||
$offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore
|
$offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore
|
||||||
$offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore
|
$offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore
|
||||||
}
|
}
|
||||||
@ -2628,6 +2628,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
$format = str_replace('%A', '__A__', $format);
|
$format = str_replace('%A', '__A__', $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$useadodb = getDolGlobalInt('MAIN_USE_LEGACY_ADODB_FOR_DATE', 0);
|
||||||
|
//$useadodb = 1; // To switch to adodb
|
||||||
|
|
||||||
// Analyze date
|
// Analyze date
|
||||||
$reg = array();
|
$reg = array();
|
||||||
@ -2647,23 +2649,76 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
$ssec = (!empty($reg[6]) ? $reg[6] : '');
|
$ssec = (!empty($reg[6]) ? $reg[6] : '');
|
||||||
|
|
||||||
$time = dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true);
|
$time = dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true);
|
||||||
$ret = adodb_strftime($format, $time + $offsettz + $offsetdst, $to_gmt);
|
if (empty($useadodb)) {
|
||||||
|
if ($to_gmt) {
|
||||||
|
$tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC
|
||||||
|
} else {
|
||||||
|
$tzo = new DateTimeZone(date_default_timezone_get()); // when to_gmt is false, base for offsettz and offsetdst (so timetouse) is PHP server
|
||||||
|
}
|
||||||
|
$dtts = new DateTime();
|
||||||
|
$dtts->setTimestamp($time);
|
||||||
|
$dtts->setTimezone($tzo);
|
||||||
|
$newformat = str_replace(
|
||||||
|
array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'),
|
||||||
|
array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'),
|
||||||
|
$format);
|
||||||
|
$ret = $dtts->format($newformat);
|
||||||
|
$ret = str_replace(
|
||||||
|
array('__£__', '__$__', '__{__', '__}__', '__[__', '__]__'),
|
||||||
|
array('T', 'Z', '__a__', '__A__', '__b__', '__B__'),
|
||||||
|
$ret);
|
||||||
|
} else {
|
||||||
|
$ret = adodb_strftime($format, $time + $offsettz + $offsetdst, $to_gmt);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Date is a timestamps
|
// Date is a timestamps
|
||||||
if ($time < 100000000000) { // Protection against bad date values
|
if ($time < 100000000000) { // Protection against bad date values
|
||||||
$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
|
$timetouse = $time + $offsettz + $offsetdst; // TODO We could be able to disable use of offsettz and offsetdst to use only offsettzstring.
|
||||||
|
|
||||||
$ret = adodb_strftime($format, $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
|
if (empty($useadodb)) {
|
||||||
|
if ($to_gmt) {
|
||||||
|
$tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC
|
||||||
|
} else {
|
||||||
|
$tzo = new DateTimeZone(date_default_timezone_get()); // when to_gmt is false, base for offsettz and offsetdst (so timetouse) is PHP server
|
||||||
|
}
|
||||||
|
$dtts = new DateTime();
|
||||||
|
$dtts->setTimestamp($timetouse);
|
||||||
|
$dtts->setTimezone($tzo);
|
||||||
|
$newformat = str_replace(
|
||||||
|
array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'),
|
||||||
|
array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'),
|
||||||
|
$format);
|
||||||
|
$ret = $dtts->format($newformat);
|
||||||
|
$ret = str_replace(
|
||||||
|
array('__£__', '__$__', '__{__', '__}__', '__[__', '__]__'),
|
||||||
|
array('T', 'Z', '__a__', '__A__', '__b__', '__B__'),
|
||||||
|
$ret);
|
||||||
|
} else {
|
||||||
|
$ret = adodb_strftime($format, $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
|
||||||
|
}
|
||||||
|
//var_dump($ret);exit;
|
||||||
} else {
|
} else {
|
||||||
$ret = 'Bad value '.$time.' for date';
|
$ret = 'Bad value '.$time.' for date';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/__b__/i', $format)) {
|
if (preg_match('/__b__/i', $format)) {
|
||||||
$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
|
$timetouse = $time + $offsettz + $offsetdst; // TODO We could be able to disable use of offsettz and offsetdst to use only offsettzstring.
|
||||||
|
|
||||||
// Here ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs.
|
if (empty($useadodb)) {
|
||||||
$month = adodb_strftime('%m', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
|
if ($to_gmt) {
|
||||||
|
$tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC
|
||||||
|
} else {
|
||||||
|
$tzo = new DateTimeZone(date_default_timezone_get()); // when to_gmt is false, base for offsettz and offsetdst (so timetouse) is PHP server
|
||||||
|
}
|
||||||
|
$dtts = new DateTime();
|
||||||
|
$dtts->setTimestamp($timetouse);
|
||||||
|
$dtts->setTimezone($tzo);
|
||||||
|
$month = $dtts->format("m");
|
||||||
|
} else {
|
||||||
|
// After this ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs.
|
||||||
|
$month = adodb_strftime('%m', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
|
||||||
|
}
|
||||||
$month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'.
|
$month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'.
|
||||||
if ($encodetooutput) {
|
if ($encodetooutput) {
|
||||||
$monthtext = $outputlangs->transnoentities('Month'.$month);
|
$monthtext = $outputlangs->transnoentities('Month'.$month);
|
||||||
@ -2682,8 +2737,21 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
//print "time=$time offsettz=$offsettz offsetdst=$offsetdst offsettzstring=$offsettzstring";
|
//print "time=$time offsettz=$offsettz offsetdst=$offsetdst offsettzstring=$offsettzstring";
|
||||||
$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
|
$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
|
||||||
|
|
||||||
$w = adodb_strftime('%w', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
|
if (empty($useadodb)) {
|
||||||
|
if ($to_gmt) {
|
||||||
|
$tzo = new DateTimeZone('UTC');
|
||||||
|
} else {
|
||||||
|
$tzo = new DateTimeZone(date_default_timezone_get());
|
||||||
|
}
|
||||||
|
$dtts = new DateTime();
|
||||||
|
$dtts->setTimestamp($timetouse);
|
||||||
|
$dtts->setTimezone($tzo);
|
||||||
|
$w = $dtts->format("w");
|
||||||
|
} else {
|
||||||
|
$w = adodb_strftime('%w', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server
|
||||||
|
}
|
||||||
$dayweek = $outputlangs->transnoentitiesnoconv('Day'.$w);
|
$dayweek = $outputlangs->transnoentitiesnoconv('Day'.$w);
|
||||||
|
|
||||||
$ret = str_replace('__A__', $dayweek, $ret);
|
$ret = str_replace('__A__', $dayweek, $ret);
|
||||||
$ret = str_replace('__a__', dol_substr($dayweek, 0, 3), $ret);
|
$ret = str_replace('__a__', dol_substr($dayweek, 0, 3), $ret);
|
||||||
}
|
}
|
||||||
@ -2714,7 +2782,6 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
*/
|
*/
|
||||||
function dol_getdate($timestamp, $fast = false, $forcetimezone = '')
|
function dol_getdate($timestamp, $fast = false, $forcetimezone = '')
|
||||||
{
|
{
|
||||||
//$datetimeobj = new DateTime('@'.$timestamp);
|
|
||||||
$datetimeobj = new DateTime();
|
$datetimeobj = new DateTime();
|
||||||
$datetimeobj->setTimestamp($timestamp); // Use local PHP server timezone
|
$datetimeobj->setTimestamp($timestamp); // Use local PHP server timezone
|
||||||
if ($forcetimezone) {
|
if ($forcetimezone) {
|
||||||
@ -3189,7 +3256,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
|
|||||||
global $conf, $user, $langs, $mysoc, $hookmanager;
|
global $conf, $user, $langs, $mysoc, $hookmanager;
|
||||||
|
|
||||||
// Clean phone parameter
|
// Clean phone parameter
|
||||||
$phone = preg_replace("/[\s.-]/", "", trim($phone));
|
$phone = is_null($phone) ? '' : preg_replace("/[\s.-]/", "", trim($phone));
|
||||||
if (empty($phone)) {
|
if (empty($phone)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -563,7 +563,7 @@ function dolSaveLicense($file, $content)
|
|||||||
*/
|
*/
|
||||||
function showWebsiteTemplates(Website $website)
|
function showWebsiteTemplates(Website $website)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $db, $form;
|
global $conf, $langs, $db, $form, $user;
|
||||||
|
|
||||||
$dirthemes = array('/doctemplates/websites');
|
$dirthemes = array('/doctemplates/websites');
|
||||||
if (!empty($conf->modules_parts['websitetemplates'])) { // Using this feature slow down application
|
if (!empty($conf->modules_parts['websitetemplates'])) { // Using this feature slow down application
|
||||||
@ -582,11 +582,15 @@ function showWebsiteTemplates(Website $website)
|
|||||||
// Title
|
// Title
|
||||||
print '<tr class="liste_titre"><th class="titlefield">';
|
print '<tr class="liste_titre"><th class="titlefield">';
|
||||||
print $form->textwithpicto($langs->trans("Templates"), $langs->trans("ThemeDir").' : '.join(", ", $dirthemes));
|
print $form->textwithpicto($langs->trans("Templates"), $langs->trans("ThemeDir").' : '.join(", ", $dirthemes));
|
||||||
|
print ' ';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.urlencode($website->ref).'&importsite=1" target="_blank" rel="noopener noreferrer external">';
|
||||||
|
print img_picto('', 'refresh');
|
||||||
|
print '</a>';
|
||||||
print '</th>';
|
print '</th>';
|
||||||
print '<th class="right">';
|
print '<th class="right">';
|
||||||
$url = 'https://www.dolistore.com/43-web-site-templates';
|
$url = 'https://www.dolistore.com/43-web-site-templates';
|
||||||
print '<a href="'.$url.'" target="_blank" rel="noopener noreferrer external">';
|
print '<a href="'.$url.'" target="_blank" rel="noopener noreferrer external">';
|
||||||
print $langs->trans('DownloadMoreSkins');
|
print img_picto('', 'globe', 'class="pictofixedwidth"').$langs->trans('DownloadMoreSkins');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</th></tr>';
|
print '</th></tr>';
|
||||||
|
|
||||||
@ -645,6 +649,9 @@ function showWebsiteTemplates(Website $website)
|
|||||||
print $subdir;
|
print $subdir;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="opacitymedium">'.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).' - '.dol_print_date(dol_filemtime($templatedir), 'dayhour', 'tzuserrel').'</span>';
|
print '<span class="opacitymedium">'.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).' - '.dol_print_date(dol_filemtime($templatedir), 'dayhour', 'tzuserrel').'</span>';
|
||||||
|
if ($user->hasRight('website', 'delete')) {
|
||||||
|
print ' <a href="'.$_SERVER["PHP_SELF"].'?action=deletetemplate&token='.newToken().'&website='.urlencode($website->ref).'&templateuserfile='.urlencode($subdir).'">'.img_picto('', 'delete').'</a>';
|
||||||
|
}
|
||||||
print '<br><a href="'.$_SERVER["PHP_SELF"].'?action=importsiteconfirm&token='.newToken().'&website='.urlencode($website->ref).'&templateuserfile='.urlencode($subdir).'" class="button">'.$langs->trans("Load").'</a>';
|
print '<br><a href="'.$_SERVER["PHP_SELF"].'?action=importsiteconfirm&token='.newToken().'&website='.urlencode($website->ref).'&templateuserfile='.urlencode($subdir).'" class="button">'.$langs->trans("Load").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -214,9 +214,9 @@ print '<div class="tabsAction">';
|
|||||||
if (empty($action)) {
|
if (empty($action)) {
|
||||||
if ($user->rights->don->supprimer) {
|
if ($user->rights->don->supprimer) {
|
||||||
if (!$disable_delete) {
|
if (!$disable_delete) {
|
||||||
print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentWithOneInvoicePaid")).'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -283,11 +283,10 @@ if (empty($action) || $action == 'delete_section') {
|
|||||||
|
|
||||||
// Actions buttons
|
// Actions buttons
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
if ($user->rights->ecm->setup) {
|
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=delete_section&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
// Delete
|
||||||
} else {
|
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->ecm->setup);
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -464,21 +464,8 @@ if ($action != 'edit' && $action != 'delete' && $action != 'deletefile') {
|
|||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('ECMAddSection').'</a>';
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('ECMAddSection').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (count($filearrayall) == 0)
|
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().($module ? '&module='.urlencode($module) : '').'§ion='.urlencode($section).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), '', $permtoadd);
|
||||||
//{
|
|
||||||
if ($permtoadd) {
|
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete_dir&token='.newToken().($module ? '&module='.$module : '').'§ion='.$section.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.$langs->trans('Delete').'</a>';
|
|
||||||
} else {
|
|
||||||
print '<a class="butActionDeleteRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
/*}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (count($filearray) > 0)
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("CannotRemoveDirectoryContainsFiles").'">'.$langs->trans('Delete').'</a>';
|
|
||||||
else
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("CannotRemoveDirectoryContainsFilesOrDirs").'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}*/
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -424,16 +424,9 @@ if ($action != 'edit') {
|
|||||||
if ($user->rights->ecm->setup) {
|
if ($user->rights->ecm->setup) {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit§ion='.urlencode($section).'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Edit').'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit§ion='.urlencode($section).'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Edit').'</a>';
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if ($user->rights->ecm->setup)
|
//print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->ecm->setup);
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=deletefile&token='.newToken().'§ion='.$section.'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -238,12 +238,13 @@ if ($resql) {
|
|||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
// Delete
|
||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
if ($user->rights->expensereport->supprimer) {
|
if ($user->rights->expensereport->supprimer) {
|
||||||
if (!$disable_delete) {
|
if (!$disable_delete) {
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($title_button).'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($title_button, $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -741,11 +741,9 @@ if ($action == 'create') {
|
|||||||
print $langs->trans("AddIntervention").'</a></div>';
|
print $langs->trans("AddIntervention").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->ficheinter->supprimer) {
|
// Delete
|
||||||
print '<div class="inline-block divButAction">';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->ficheinter->supprimer);
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$object->id.'">';
|
|
||||||
print $langs->trans('Delete').'</a></div>';
|
|
||||||
}
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("ErrorRecordNotFound");
|
print $langs->trans("ErrorRecordNotFound");
|
||||||
|
|||||||
@ -104,6 +104,7 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
|
|||||||
|
|
||||||
$permissionnote = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $user->rights->ficheinter->creer; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $user->rights->ficheinter->creer; // Used by the include of actions_dellink.inc.php
|
||||||
|
$permissiontodelete = (($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1688,10 +1689,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
if (($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'"';
|
|
||||||
print '>'.$langs->trans('Delete').'</a></div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1621,10 +1621,8 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if ($object->statut == Facture::STATUS_DRAFT && ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer))
|
// Delete
|
||||||
if (($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer)) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=ask_deleteinvoice&token='.newToken(), 'delete', ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer));
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?action=ask_deleteinvoice&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans('Delete') . '</a></div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -374,9 +374,9 @@ if ($result > 0) {
|
|||||||
if ($user->socid == 0 && $action == '') {
|
if ($user->socid == 0 && $action == '') {
|
||||||
if ($user->rights->fournisseur->facture->supprimer) {
|
if ($user->rights->fournisseur->facture->supprimer) {
|
||||||
if ($allow_delete) {
|
if ($allow_delete) {
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$title_button.'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($title_button, $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -420,8 +420,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
* Action bar
|
* Action bar
|
||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
// Modify
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$id.'">'.$langs->trans('Delete').'</a>';
|
|
||||||
|
// Delete
|
||||||
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
ADOdb Date Library, part of the ADOdb abstraction library
|
ADOdb Date Library, part of the ADOdb abstraction library
|
||||||
See Wiki: https://adodb.org/dokuwiki/doku.php?id=v5:datetime:datetime_index
|
See Wiki: https://adodb.org/dokuwiki/doku.php?id=v5:datetime:datetime_index
|
||||||
Download: https://github.com/ADOdb/ADOdb/blob/master/adodb-time.inc.php
|
Download: https://github.com/ADOdb/ADOdb/blob/master/adodb-time.inc.php
|
||||||
|
|
||||||
PHP native date functions use integer timestamps for computations.
|
PHP native date functions use integer timestamps for computations.
|
||||||
Because of this, dates are restricted to the years 1901-2038 on Unix
|
Because of this, dates are restricted to the years 1901-2038 on Unix
|
||||||
|
|||||||
@ -762,7 +762,7 @@ class JavascriptRenderer
|
|||||||
return $uris;
|
return $uris;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) {
|
if ($uri && (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri))) {
|
||||||
return $uri;
|
return $uri;
|
||||||
}
|
}
|
||||||
return rtrim($root, '/') . "/$uri";
|
return rtrim($root, '/') . "/$uri";
|
||||||
@ -778,7 +778,7 @@ class JavascriptRenderer
|
|||||||
protected function filterAssetArray($array, $type = null)
|
protected function filterAssetArray($array, $type = null)
|
||||||
{
|
{
|
||||||
$types = array('css', 'js', 'inline_css', 'inline_js', 'inline_head');
|
$types = array('css', 'js', 'inline_css', 'inline_js', 'inline_head');
|
||||||
$typeIndex = array_search(strtolower($type), $types);
|
$typeIndex = is_null($type) ? false : array_search(strtolower($type), $types);
|
||||||
return $typeIndex !== false ? $array[$typeIndex] : $array;
|
return $typeIndex !== false ? $array[$typeIndex] : $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -558,7 +558,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate);
|
$textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate);
|
||||||
$textLateTitle .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')';
|
$textLateTitle .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil(empty($board->warning_delay) ? 0 : $board->warning_delay) >= 0 ? '+' : '').ceil(empty($board->warning_delay) ? 0 : $board->warning_delay).' '.$langs->trans("days").')';
|
||||||
|
|
||||||
if ($board->id == 'bank_account') {
|
if ($board->id == 'bank_account') {
|
||||||
$textLateTitle .= '<br><span class="opacitymedium">'.$langs->trans("IfYouDontReconcileDisableProperty", $langs->transnoentitiesnoconv("Conciliable")).'</span>';
|
$textLateTitle .= '<br><span class="opacitymedium">'.$langs->trans("IfYouDontReconcileDisableProperty", $langs->transnoentitiesnoconv("Conciliable")).'</span>';
|
||||||
|
|||||||
@ -185,4 +185,3 @@ AlreadyOneBankAccount=Already one bank account defined
|
|||||||
SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation=SEPA transfer: 'Payment Type' at 'Credit Transfer' level
|
SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation=SEPA transfer: 'Payment Type' at 'Credit Transfer' level
|
||||||
SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp=When generatin a SEPA XML file for Credit transfers, the section "PaymentTypeInformation" can now be placed inside the "CreditTransferTransactionInformation" section (instead of "Payment" section). We strongly recommend to keep this unchecked to place PaymentTypeInformation at Payment level, as all banks will not necessarily accept it at CreditTransferTransactionInformation level. Contact your bank before placing PaymentTypeInformation at CreditTransferTransactionInformation level.
|
SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp=When generatin a SEPA XML file for Credit transfers, the section "PaymentTypeInformation" can now be placed inside the "CreditTransferTransactionInformation" section (instead of "Payment" section). We strongly recommend to keep this unchecked to place PaymentTypeInformation at Payment level, as all banks will not necessarily accept it at CreditTransferTransactionInformation level. Contact your bank before placing PaymentTypeInformation at CreditTransferTransactionInformation level.
|
||||||
ToCreateRelatedRecordIntoBank=To create missing related bank record
|
ToCreateRelatedRecordIntoBank=To create missing related bank record
|
||||||
BanklineExtraFields=Bank Line Extrafields
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@ Language_da_DK=Danish
|
|||||||
Language_de_DE=German
|
Language_de_DE=German
|
||||||
Language_de_AT=German (Austria)
|
Language_de_AT=German (Austria)
|
||||||
Language_de_CH=German (Switzerland)
|
Language_de_CH=German (Switzerland)
|
||||||
|
Language_de_LU=German (Luxembourg)
|
||||||
Language_el_GR=Greek
|
Language_el_GR=Greek
|
||||||
Language_el_CY=Greek (Cyprus)
|
Language_el_CY=Greek (Cyprus)
|
||||||
Language_en_AE=English (United Arab Emirates)
|
Language_en_AE=English (United Arab Emirates)
|
||||||
|
|||||||
@ -66,7 +66,7 @@ ContractRefused=Contract refused
|
|||||||
RecruitmentCandidature=Application
|
RecruitmentCandidature=Application
|
||||||
JobPositions=Job positions
|
JobPositions=Job positions
|
||||||
RecruitmentCandidatures=Applications
|
RecruitmentCandidatures=Applications
|
||||||
InterviewToDo=Interview to do
|
InterviewToDo=Contacts to follow
|
||||||
AnswerCandidature=Application answer
|
AnswerCandidature=Application answer
|
||||||
YourCandidature=Your application
|
YourCandidature=Your application
|
||||||
YourCandidatureAnswerMessage=Thanks you for your application.<br>...
|
YourCandidatureAnswerMessage=Thanks you for your application.<br>...
|
||||||
|
|||||||
@ -150,4 +150,6 @@ ErrorFaviconSize=Favicon must be sized 16x16, 32x32 or 64x64
|
|||||||
FaviconTooltip=Upload an image which needs to be a png (16x16, 32x32 or 64x64)
|
FaviconTooltip=Upload an image which needs to be a png (16x16, 32x32 or 64x64)
|
||||||
NextContainer=Next page/container
|
NextContainer=Next page/container
|
||||||
PreviousContainer=Previous page/container
|
PreviousContainer=Previous page/container
|
||||||
WebsiteMustBeDisabled=The website must have the status "Disabled"
|
WebsiteMustBeDisabled=The website must have the status "%s"
|
||||||
|
WebpageMustBeDisabled=The web page must have the status "%s"
|
||||||
|
SetWebsiteOnlineBefore=When website is offline, all pages are offline. Change status of website first.
|
||||||
|
|||||||
@ -223,9 +223,9 @@ print '<div class="tabsAction">';
|
|||||||
|
|
||||||
if (empty($action) && !empty($user->rights->loan->delete)) {
|
if (empty($action) && !empty($user->rights->loan->delete)) {
|
||||||
if (!$disable_delete) {
|
if (!$disable_delete) {
|
||||||
print '<a class="butActionDelete" href="card.php?id='.$id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentWithOneInvoicePaid")).'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -535,7 +535,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd);
|
if ($permissiontoadd) {
|
||||||
|
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
@ -554,8 +556,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete
|
||||||
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
|
$params = array();
|
||||||
|
print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete, $params);
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -678,7 +678,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->fk_soc.'&action=clone&object=mo">'.$langs->trans("ToClone").'</a>';
|
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=mo', 'clone', $permissiontoadd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cancel - Reopen
|
// Cancel - Reopen
|
||||||
@ -703,12 +703,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete
|
||||||
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
} else {
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,6 +61,10 @@ $hookmanager->initHooks(array('surveycard', 'globalcard'));
|
|||||||
|
|
||||||
$expiredate = dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear'));
|
$expiredate = dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear'));
|
||||||
|
|
||||||
|
$permissiontoread = $user->rights->opensurvey->read;
|
||||||
|
$permissiontoadd = $user->rights->opensurvey->write;
|
||||||
|
// permission delete doesn't exists
|
||||||
|
$permissiontodelete = $user->rights->opensurvey->write;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -364,26 +368,25 @@ print '</form>'."\n";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
// Action bar
|
||||||
* Action bar
|
|
||||||
*/
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($action != 'edit' && $user->rights->opensurvey->write) {
|
if ($action != 'edit' && $user->rights->opensurvey->write) {
|
||||||
//Modify button
|
// Modify button
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("Modify").'</a>';
|
||||||
|
|
||||||
if ($object->status == Opensurveysondage::STATUS_VALIDATED) {
|
if ($object->status == Opensurveysondage::STATUS_VALIDATED) {
|
||||||
//Close button
|
// Close button
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("Close").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("Close").'</a>';
|
||||||
}
|
}
|
||||||
if ($object->status == Opensurveysondage::STATUS_CLOSED) {
|
if ($object->status == Opensurveysondage::STATUS_CLOSED) {
|
||||||
//Opened button
|
// Re-Open
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("ReOpen").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans("ReOpen").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
//Delete button
|
// Delete
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?suppressionsondage=1&action=delete&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?suppressionsondage=1&id='.urlencode($numsondage).'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -417,17 +417,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
/*if ($permissiontoadd)
|
if ($permissiontoadd) {
|
||||||
{
|
//print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=inventory', 'clone', $permissiontoadd);
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=myobject">'.$langs->trans("ToClone").'</a>'."\n";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
|
||||||
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) {
|
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
} else {
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete
|
||||||
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -540,10 +540,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a></div>'."\n";
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a></div>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->stock->supprimer)
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->stock->supprimer);
|
||||||
{
|
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a></div>'."\n";
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
|||||||
$permissiontoread = $user->rights->stocktransfer->stocktransfer->read;
|
$permissiontoread = $user->rights->stocktransfer->stocktransfer->read;
|
||||||
$permissiontoadd = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
$permissiontoadd = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
$permissionnote = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiontodelete = $user->rights->stocktransfer->stocktransfer->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
$permissiontodelete = $user->rights->stocktransfer->stocktransfer->delete || ($permissiontoadd && isset($object->status) && $object->status < $object::STATUS_TRANSFERED);
|
||||||
$permissiondellink = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_dellink.inc.php
|
||||||
$upload_dir = $conf->stocktransfer->multidir_output[isset($object->entity) ? $object->entity : 1];
|
$upload_dir = $conf->stocktransfer->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||||
|
|
||||||
@ -964,7 +964,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=stocktransfer">'.$langs->trans("ToClone").'</a>'."\n";
|
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=stocktransfer', 'clone', $permissiontoadd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -992,14 +992,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete
|
||||||
if ($object->status < $object::STATUS_TRANSFERED && $permissiontodelete) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
}
|
|
||||||
/*else
|
|
||||||
{
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1401,7 +1401,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||||||
// Delete
|
// Delete
|
||||||
if ($user->rights->projet->supprimer || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) {
|
if ($user->rights->projet->supprimer || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) {
|
||||||
if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) {
|
if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) {
|
||||||
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
|
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
|
||||||
} else {
|
} else {
|
||||||
print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -674,14 +674,15 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
if ($user->rights->projet->supprimer) {
|
$permissiontodelete = $user->hasRight('projet', 'supprimer');
|
||||||
|
if ($permissiontodelete) {
|
||||||
if (!$object->hasChildren() && !$object->hasTimeSpent()) {
|
if (!$object->hasChildren() && !$object->hasTimeSpent()) {
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().'&withproject='.((int) $withproject).'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&withproject='.((int) $withproject), 'delete', $permissiontodelete);
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("TaskHasChild").'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("TaskHasChild"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&withproject='.((int) $withproject), 'delete', 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&withproject='.((int) $withproject), 'delete', $permissiontodelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -127,7 +127,7 @@ class RecruitmentCandidature extends CommonObject
|
|||||||
'remuneration_requested' => array('type'=>'integer', 'label'=>'RequestedRemuneration', 'enabled'=>'1', 'position'=>80, 'notnull'=>0, 'visible'=>-1,),
|
'remuneration_requested' => array('type'=>'integer', 'label'=>'RequestedRemuneration', 'enabled'=>'1', 'position'=>80, 'notnull'=>0, 'visible'=>-1,),
|
||||||
'remuneration_proposed' => array('type'=>'integer', 'label'=>'ProposedRemuneration', 'enabled'=>'1', 'position'=>81, 'notnull'=>0, 'visible'=>-1,),
|
'remuneration_proposed' => array('type'=>'integer', 'label'=>'ProposedRemuneration', 'enabled'=>'1', 'position'=>81, 'notnull'=>0, 'visible'=>-1,),
|
||||||
'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>300, 'notnull'=>0, 'visible'=>3, 'cssview'=>'wordbreak'),
|
'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>300, 'notnull'=>0, 'visible'=>3, 'cssview'=>'wordbreak'),
|
||||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>1, 'csslist'=>'nowraponall'),
|
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-4, 'csslist'=>'nowraponall'),
|
||||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2, 'csslist'=>'nowraponall'),
|
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2, 'csslist'=>'nowraponall'),
|
||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
||||||
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
|
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
|
||||||
|
|||||||
@ -526,7 +526,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
// Back to draft
|
// Back to draft
|
||||||
if ($object->status == $object::STATUS_VALIDATED) {
|
if ($object->status == $object::STATUS_VALIDATED) {
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes">'.$langs->trans("SetToDraft").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&token='.newToken().'&confirm=yes">'.$langs->trans("SetToDraft").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,7 +565,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=recruitmentcandidature">'.$langs->trans("ToClone").'</a>'."\n";
|
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=recruitmentcandidature', 'clone', $permissiontoadd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Button to convert into a user
|
// Button to convert into a user
|
||||||
@ -592,12 +592,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete
|
||||||
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
} else {
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -435,7 +435,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=recruitmentjobposition">'.$langs->trans("ToClone").'</a>'."\n";
|
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=recruitmentjobposition', 'clone', $permissiontoadd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -452,12 +452,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete
|
||||||
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
} else {
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
|||||||
$result = restrictedArea($user, 'resource', $object->id, 'resource');
|
$result = restrictedArea($user, 'resource', $object->id, 'resource');
|
||||||
|
|
||||||
$permissiontoadd = $user->rights->resource->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
$permissiontoadd = $user->rights->resource->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
|
$permissiontodelete = $user->rights->resource->delete;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -349,12 +349,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($action != "delete" && $action != "create" && $action != "edit") {
|
if ($action != "delete" && $action != "create" && $action != "edit") {
|
||||||
// Delete resource
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
if ($user->rights->resource->delete) {
|
|
||||||
print '<div class="inline-block divButAction">';
|
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&action=delete&token='.newToken().'" class="butActionDelete">'.$langs->trans('Delete').'</a>';
|
|
||||||
print '</div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -251,9 +251,9 @@ print '<div class="tabsAction">';
|
|||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
if ($user->rights->salaries->delete) {
|
if ($user->rights->salaries->delete) {
|
||||||
if (!$disable_delete) {
|
if (!$disable_delete) {
|
||||||
print '<a class="butActionDelete" href="card.php?id='.GETPOST('id', 'int').'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentSalaryPaid")).'">'.$langs->trans('Delete').'</a>';
|
print dolGetButtonAction($langs->trans("CantRemovePaymentSalaryPaid"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if (empty($reshook)) {
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'mesgs');
|
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans('Delete'), null, 'errors');
|
setEventMessages($langs->trans('RecordDeleted'), null, 'errors');
|
||||||
}
|
}
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2003,10 +2003,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
if (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete) {
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', ($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete);
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'"';
|
|
||||||
print '>'.$langs->trans('Delete').'</a></div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -285,7 +285,7 @@ section.setupsection {
|
|||||||
div.tabBar textarea:focus {
|
div.tabBar textarea:focus {
|
||||||
border: 1px solid #aaa !important;
|
border: 1px solid #aaa !important;
|
||||||
}
|
}
|
||||||
input:focus:not(.button):not(.select2-search__field):not(#top-bookmark-search-input):not(.search_component_input):not(.input-search-takepos),
|
input:focus:not(.button):not(.buttonwebsite):not(.select2-search__field):not(#top-bookmark-search-input):not(.search_component_input):not(.input-search-takepos),
|
||||||
select:focus, .select2-container--open [aria-expanded="false"].select2-selection--single {
|
select:focus, .select2-container--open [aria-expanded="false"].select2-selection--single {
|
||||||
/* div.tabBar input:focus, div.tabBar select:focus { */
|
/* div.tabBar input:focus, div.tabBar select:focus { */
|
||||||
border-bottom: 1px solid #666 !important;
|
border-bottom: 1px solid #666 !important;
|
||||||
@ -620,11 +620,12 @@ table.tableforfield .buttonDelete:not(.bordertransp):not(.buttonpayment) {
|
|||||||
-webkit-box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
-webkit-box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
||||||
box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
||||||
}
|
}
|
||||||
.button:disabled, .buttonDelete:disabled, .button.disabled {
|
.button:disabled, .buttonDelete:disabled, .button.disabled, .buttonDelete.disabled {
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
cursor: auto;
|
cursor: auto;
|
||||||
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.buttonRefused {
|
.buttonRefused {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@ -5141,7 +5142,7 @@ tr.visible {
|
|||||||
.websiteformtoolbar {
|
.websiteformtoolbar {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '32px' : '52px') : '0'; ?>;
|
top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '32px' : '52px') : '0'; ?>;
|
||||||
z-index: 1000;
|
z-index: 1002; /* Dolibarr menu is 1001, Website menu is 1002 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.exampleapachesetup {
|
.exampleapachesetup {
|
||||||
|
|||||||
@ -4996,7 +4996,7 @@ tr.visible {
|
|||||||
.websiteformtoolbar {
|
.websiteformtoolbar {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '36px' : '50px') : '0'; ?>;
|
top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '36px' : '50px') : '0'; ?>;
|
||||||
z-index: 1000;
|
z-index: 1002; /* Dolibarr menu is 1001, Website menu is 1002 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.exampleapachesetup {
|
.exampleapachesetup {
|
||||||
|
|||||||
@ -501,7 +501,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete (need delete permission, or if draft, just need create/modify permission)
|
||||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
|
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -875,10 +875,10 @@ class Website extends CommonObject
|
|||||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||||
global $langs;
|
global $langs;
|
||||||
//$langs->load("mymodule");
|
//$langs->load("mymodule");
|
||||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline');
|
||||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online');
|
||||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline');
|
||||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online');
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusType = 'status5';
|
$statusType = 'status5';
|
||||||
|
|||||||
@ -838,10 +838,10 @@ class WebsitePage extends CommonObject
|
|||||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||||
global $langs;
|
global $langs;
|
||||||
//$langs->load("mymodule");
|
//$langs->load("mymodule");
|
||||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline');
|
||||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online');
|
||||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline');
|
||||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online');
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusType = 'status5';
|
$statusType = 'status5';
|
||||||
|
|||||||
@ -420,6 +420,18 @@ if ($action == 'renamefile') { // Must be after include DOL_DOCUMENT_ROOT.'/core
|
|||||||
$action = 'file_manager';
|
$action = 'file_manager';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'setwebsiteonline') {
|
||||||
|
$website->setStatut($website::STATUS_VALIDATED, null, '', 'WEBSITE_MODIFY', 'status');
|
||||||
|
|
||||||
|
header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int'));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if ($action == 'setwebsiteoffline') {
|
||||||
|
$result = $website->setStatut($website::STATUS_DRAFT, null, '', 'WEBSITE_MODIFY', 'status');
|
||||||
|
|
||||||
|
header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int'));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
if ($action == 'seteditinline') {
|
if ($action == 'seteditinline') {
|
||||||
dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1);
|
dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1);
|
||||||
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings');
|
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings');
|
||||||
@ -449,6 +461,35 @@ if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && !$searc
|
|||||||
$massaction = '';
|
$massaction = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'deletetemplate') {
|
||||||
|
$dirthemes = array('/doctemplates/websites');
|
||||||
|
if (!empty($conf->modules_parts['websitetemplates'])) { // Using this feature slow down application
|
||||||
|
foreach ($conf->modules_parts['websitetemplates'] as $reldir) {
|
||||||
|
$dirthemes = array_merge($dirthemes, (array) ($reldir.'doctemplates/websites'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$dirthemes = array_unique($dirthemes);
|
||||||
|
|
||||||
|
|
||||||
|
// Delete template files and dir
|
||||||
|
$mode = 'importsite';
|
||||||
|
$action = 'importsite';
|
||||||
|
|
||||||
|
if (count($dirthemes)) {
|
||||||
|
$i = 0;
|
||||||
|
foreach ($dirthemes as $dir) {
|
||||||
|
//print $dirroot.$dir;exit;
|
||||||
|
$dirtheme = DOL_DATA_ROOT.$dir; // This include loop on $conf->file->dol_document_root
|
||||||
|
if (is_dir($dirtheme)) {
|
||||||
|
$templateuserfile = GETPOST('templateuserfile');
|
||||||
|
$imguserfile = preg_replace('/\.zip$/', '', $templateuserfile).'.jpg';
|
||||||
|
dol_delete_file($dirtheme.'/'.$templateuserfile);
|
||||||
|
dol_delete_file($dirtheme.'/'.$imguserfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set category
|
// Set category
|
||||||
if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
|
if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -487,7 +528,8 @@ if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $us
|
|||||||
// Now we reload list
|
// Now we reload list
|
||||||
$listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters, -1);
|
$listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters, -1);
|
||||||
}
|
}
|
||||||
// Set category
|
|
||||||
|
// Del category
|
||||||
if ($massaction == 'delcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
|
if ($massaction == 'delcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$nbupdate = 0;
|
$nbupdate = 0;
|
||||||
@ -2720,6 +2762,11 @@ if (!GETPOST('hide_websitemenu')) {
|
|||||||
}
|
}
|
||||||
$atleastonepage = (is_array($array) && count($array) > 0);
|
$atleastonepage = (is_array($array) && count($array) > 0);
|
||||||
|
|
||||||
|
$websitepage = new WebSitePage($db);
|
||||||
|
if ($pageid > 0 && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone')) {
|
||||||
|
$websitepage->fetch($pageid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//var_dump($objectpage);exit;
|
//var_dump($objectpage);exit;
|
||||||
print '<div class="centpercent websitebar'.(GETPOST('dol_openinpopup', 'aZ09') ? ' hidden' : '').'">';
|
print '<div class="centpercent websitebar'.(GETPOST('dol_openinpopup', 'aZ09') ? ' hidden' : '').'">';
|
||||||
@ -2730,28 +2777,25 @@ if (!GETPOST('hide_websitemenu')) {
|
|||||||
|
|
||||||
print '<!-- Bar for website -->';
|
print '<!-- Bar for website -->';
|
||||||
if ($action != 'file_manager') {
|
if ($action != 'file_manager') {
|
||||||
print '<span class="websiteselection hideonsmartphoneimp minwidth100 tdoverflowmax100">';
|
print '<div class="websiteselection hideonsmartphoneimp minwidth75 tdoverflowmax100 inline-block">';
|
||||||
print $langs->trans("Website").': ';
|
print $langs->trans("Website").': ';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
// Button Add new website
|
||||||
|
$urltocreatenewwebsite = $_SERVER["PHP_SELF"].'?action=createsite';
|
||||||
|
print '<span class="websiteselection paddingrightonly">';
|
||||||
|
print '<a href="'.$urltocreatenewwebsite.'" class=""'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddWebsite")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"><span></a>';
|
||||||
print '</span>';
|
print '</span>';
|
||||||
|
|
||||||
$urltocreatenewwebsite = $_SERVER["PHP_SELF"].'?action=createsite';
|
|
||||||
if (empty($conf->use_javascript_ajax)) {
|
|
||||||
print '<span class="websiteselection hideonsmartphoneimp">';
|
|
||||||
print '<a href="'.$urltocreatenewwebsite.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddWebsite")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"><span></a>';
|
|
||||||
print '</span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// List of website
|
// List of website
|
||||||
print '<span class="websiteselection">';
|
print '<span class="websiteselection nopaddingrightimp">';
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
$out .= '<select name="website" class="minwidth100 width200 maxwidth150onsmartphone" id="website">';
|
$out .= '<select name="website" class="minwidth100 width200 maxwidth150onsmartphone" id="website">';
|
||||||
if (empty($object->records)) {
|
if (empty($object->records)) {
|
||||||
$out .= '<option value="-1"> </option>';
|
$out .= '<option value="-1"> </option>';
|
||||||
}
|
}
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
|
||||||
$valueoption = '<span class="classlink">'.img_picto('', 'add', 'class="paddingrightonly"').$langs->trans("AddWebsite").'</span>';
|
|
||||||
$out .= '<option value="-2" data-html="'.dol_escape_htmltag($valueoption).'">'.$valueoption.'</option>';
|
|
||||||
}
|
|
||||||
// Loop on each sites
|
// Loop on each sites
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($object->records as $key => $valwebsite) {
|
foreach ($object->records as $key => $valwebsite) {
|
||||||
@ -2792,16 +2836,40 @@ if (!GETPOST('hide_websitemenu')) {
|
|||||||
}
|
}
|
||||||
print $out;
|
print $out;
|
||||||
|
|
||||||
if (empty($conf->use_javascript_ajax)) {
|
print '</span>';
|
||||||
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshsite" value="'.$langs->trans("Load").'">';
|
|
||||||
|
// Switch offline/onine
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
print '<span class="websiteselection">';
|
||||||
|
// Do not use ajax, we need a refresh of full page when we change status of a website
|
||||||
|
//print '<div class="inline-block marginrightonly">';
|
||||||
|
//print ajax_object_onoff($object, 'status', 'status', 'Online', 'Offline', array(), 'valignmiddle', 'statuswebsite');
|
||||||
|
//print '</div>';
|
||||||
|
if ($website->status == $website::STATUS_DRAFT) {
|
||||||
|
$text_off = 'Offline';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setwebsiteonline&token='.newToken().'&website='.urlencode($website->ref).'&websitepage='.((int) $websitepage->id).'">'.img_picto($langs->trans($text_off), 'switch_off').'</a>';
|
||||||
|
} else {
|
||||||
|
$text_off = 'Online';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setwebsiteoffline&token='.newToken().'&website='.urlencode($website->ref).'&websitepage='.((int) $websitepage->id).'">'.img_picto($langs->trans($text_off), 'switch_on').'</a>';
|
||||||
|
}
|
||||||
|
print '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Refresh / Reload web site (for non javascript browers)
|
||||||
|
if (empty($conf->use_javascript_ajax)) {
|
||||||
|
print '<span class="websiteselection">';
|
||||||
|
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshsite" value="'.$langs->trans("Load").'">';
|
||||||
|
print '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print '<span class="websiteselection">';
|
||||||
|
|
||||||
if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) {
|
if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) {
|
||||||
print ' ';
|
// Edit website properties
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.urlencode($object->ref).'&pageid='.((int) $pageid).'&action=editcss&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditCss")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditCss")).'</span></a>';
|
||||||
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditCss")).'" name="editcss">';
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editcss&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditCss")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditCss")).'</span></a>';
|
|
||||||
|
|
||||||
|
// Import web site
|
||||||
$importlabel = $langs->trans("ImportSite");
|
$importlabel = $langs->trans("ImportSite");
|
||||||
$exportlabel = $langs->trans("ExportSite");
|
$exportlabel = $langs->trans("ExportSite");
|
||||||
if (!empty($conf->dol_optimize_smallscreen)) {
|
if (!empty($conf->dol_optimize_smallscreen)) {
|
||||||
@ -2815,17 +2883,23 @@ if (!GETPOST('hide_websitemenu')) {
|
|||||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
||||||
}
|
}
|
||||||
|
|
||||||
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">';
|
// Export web site
|
||||||
print '<input type="submit" class="button bordertransp"'.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
|
print '<input type="submit" class="button bordertransp"'.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
|
||||||
|
|
||||||
|
// Clone web site
|
||||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
||||||
|
|
||||||
// Delete website
|
// Delete website
|
||||||
if ($website->status == $website::STATUS_VALIDATED) {
|
if ($website->status == $website::STATUS_VALIDATED) {
|
||||||
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("WebsiteMustBeDisabled")).'">';
|
$disabled = ' disabled="disabled"';
|
||||||
|
$title = $langs->trans("WebsiteMustBeDisabled", $langs->transnoentitiesnoconv($website->LibStatut(0, 0)));
|
||||||
|
$url = '#';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'">';
|
$disabled = '';
|
||||||
|
$title = $langs->trans("Delete");
|
||||||
|
$url = $_SERVER["PHP_SELF"].'?action=deletesite&token='.newToken().'&website='.urlencode($website->ref);
|
||||||
}
|
}
|
||||||
|
print '<a href="'.$url.'" class="buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>';
|
||||||
|
|
||||||
// Regenerate all pages
|
// Regenerate all pages
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=regeneratesite&token='.newToken().'&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"><span class="far fa-hdd"></span></a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=regeneratesite&token='.newToken().'&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"><span class="far fa-hdd"></span></a>';
|
||||||
@ -2833,6 +2907,7 @@ if (!GETPOST('hide_websitemenu')) {
|
|||||||
// Generate site map
|
// Generate site map
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=confirmgeneratesitemaps&token='.newToken().'&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'"><span class="fa fa-sitemap"></span></a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=confirmgeneratesitemaps&token='.newToken().'&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'"><span class="fa fa-sitemap"></span></a>';
|
||||||
|
|
||||||
|
// Find / replace tool
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=replacesite&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"><span class="fa fa-search"></span></a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=replacesite&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"><span class="fa fa-search"></span></a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2940,53 +3015,64 @@ if (!GETPOST('hide_websitemenu')) {
|
|||||||
print '<!-- Bar for websitepage -->';
|
print '<!-- Bar for websitepage -->';
|
||||||
print '<div class="centpercent websitebar"'.($style ? ' style="'.$style.'"' : '').'">';
|
print '<div class="centpercent websitebar"'.($style ? ' style="'.$style.'"' : '').'">';
|
||||||
|
|
||||||
print '<span class="websiteselection hideonsmartphoneimp minwidth100 tdoverflowmax100">';
|
print '<div class="websiteselection hideonsmartphoneimp minwidth75 tdoverflowmax100 inline-block">';
|
||||||
print $langs->trans("PageContainer").': ';
|
print $langs->trans("PageContainer").': ';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
// Button Add new web page
|
||||||
|
print '<span class="websiteselection paddingrightonly">';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref).'" class=""'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"></span></a>';
|
||||||
print '</span>';
|
print '</span>';
|
||||||
|
|
||||||
print '<span class="websiteselection">';
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"></span></a>';
|
|
||||||
print '</span>';
|
|
||||||
|
|
||||||
//print '<span class="websiteselection">';
|
$out = '';
|
||||||
|
|
||||||
if ($action != 'addcontainer') {
|
$s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'minwidth100 maxwidth200onsmartphone');
|
||||||
$out = '';
|
|
||||||
|
|
||||||
$s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'maxwidth200onsmartphone');
|
$out .= '<span class="websiteselection nopaddingrightimp">';
|
||||||
|
$out .= $s;
|
||||||
|
$out .= '</span>';
|
||||||
|
|
||||||
if ($formwebsite->num > 0) {
|
$urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref);
|
||||||
$out .= '<span class="websiteselection">';
|
|
||||||
$out .= $s;
|
|
||||||
$out .= '</span>';
|
|
||||||
|
|
||||||
$urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref);
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
$out .= '<script type="text/javascript">';
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
$out .= 'jQuery(document).ready(function () {';
|
||||||
$out .= '<script type="text/javascript">';
|
$out .= ' jQuery("#pageid").change(function () {';
|
||||||
$out .= 'jQuery(document).ready(function () {';
|
$out .= ' console.log("We select "+jQuery("#pageid option:selected").val());';
|
||||||
$out .= ' jQuery("#pageid").change(function () {';
|
$out .= ' if (jQuery("#pageid option:selected").val() == \'-2\') {';
|
||||||
$out .= ' console.log("We select "+jQuery("#pageid option:selected").val());';
|
$out .= ' window.location.href = "'.$urltocreatenewpage.'";';
|
||||||
$out .= ' if (jQuery("#pgeid option:selected").val() == \'-2\') {';
|
$out .= ' } else {';
|
||||||
$out .= ' window.location.href = "'.$urltocreatenewpage.'";';
|
$out .= ' window.location.href = "'.$_SERVER["PHP_SELF"].'?website='.urlencode($website->ref).'&pageid="+jQuery("#pageid option:selected").val();';
|
||||||
$out .= ' } else {';
|
$out .= ' }';
|
||||||
$out .= ' window.location.href = "'.$_SERVER["PHP_SELF"].'?website='.urlencode($website->ref).'&pageid="+jQuery("#pageid option:selected").val();';
|
$out .= ' });';
|
||||||
$out .= ' }';
|
$out .= '});';
|
||||||
$out .= ' });';
|
$out .= '</script>';
|
||||||
$out .= '});';
|
|
||||||
$out .= '</script>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print $out;
|
|
||||||
} else {
|
|
||||||
print $langs->trans("New");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print $out;
|
||||||
|
|
||||||
|
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
print '<span class="websiteselection">';
|
||||||
|
//print '<div class="inline-block marginrightonly">';
|
||||||
|
if ($object->status == $object::STATUS_DRAFT) { // website is off, we do not allow to change status of page
|
||||||
|
$text_off = 'SetWebsiteOnlineBefore';
|
||||||
|
if ($objectpage->status == $objectpage::STATUS_DRAFT) {
|
||||||
|
print '<span class="valignmiddle disabled opacitymedium">'.img_picto($langs->trans($text_off), 'switch_off').'</span>';
|
||||||
|
} else {
|
||||||
|
print '<span class="valignmiddle disabled opacitymedium">'.img_picto($langs->trans($text_off), 'switch_on').'</span>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print ajax_object_onoff($objectpage, 'status', 'status', 'Online', 'Offline', array(), 'valignmiddle', 'statuswebsitepage');
|
||||||
|
}
|
||||||
|
//print '</div>';
|
||||||
|
print '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<span class="websiteselection">';
|
print '<span class="websiteselection">';
|
||||||
|
|
||||||
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshpage" value="'.$langs->trans("Load").'"'.(($atleastonepage && $action != 'editsource') ? '' : ' disabled="disabled"').'>';
|
print '<input type="image" class="valignmiddle buttonwebsite" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshpage" value="'.$langs->trans("Load").'"'.(($action != 'editsource') ? '' : ' disabled="disabled"').'>';
|
||||||
|
|
||||||
// Print nav arrows
|
// Print nav arrows
|
||||||
$pagepreviousid = 0;
|
$pagepreviousid = 0;
|
||||||
@ -3015,23 +3101,18 @@ if (!GETPOST('hide_websitemenu')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($pagepreviousid) {
|
if ($pagepreviousid) {
|
||||||
print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?website='.urlencode($object->ref).'&pageid='.$pagepreviousid.'&action='.$action.'&token='.newToken().'">'.img_previous($langs->trans("PreviousContainer")).'</a>';
|
print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?website='.urlencode($object->ref).'&pageid='.((int) $pagepreviousid).'&action='.urlencode($action).'&token='.newToken().'">'.img_previous($langs->trans("PreviousContainer")).'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="valignmiddle opacitymedium">'.img_previous($langs->trans("PreviousContainer")).'</span>';
|
print '<span class="valignmiddle opacitymedium">'.img_previous($langs->trans("PreviousContainer")).'</span>';
|
||||||
}
|
}
|
||||||
if ($pagenextid) {
|
if ($pagenextid) {
|
||||||
print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?website='.urlencode($object->ref).'&pageid='.$pagenextid.'&action='.$action.'&token='.newToken().'">'.img_next($langs->trans("NextContainer")).'</a>';
|
print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?website='.urlencode($object->ref).'&pageid='.((int) $pagenextid).'&action='.urlencode($action).'&token='.newToken().'">'.img_next($langs->trans("NextContainer")).'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="valignmiddle opacitymedium">'.img_next($langs->trans("NextContainer")).'</span>';
|
print '<span class="valignmiddle opacitymedium">'.img_next($langs->trans("NextContainer")).'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</span>';
|
print '</span>';
|
||||||
|
|
||||||
$websitepage = new WebSitePage($db);
|
|
||||||
if ($pageid > 0 && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone')) {
|
|
||||||
$websitepage->fetch($pageid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite') {
|
if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite') {
|
||||||
$disabled = '';
|
$disabled = '';
|
||||||
if (empty($user->rights->website->write)) {
|
if (empty($user->rights->website->write)) {
|
||||||
@ -3109,15 +3190,15 @@ if (!GETPOST('hide_websitemenu')) {
|
|||||||
|
|
||||||
print '<span class="websiteselection">';
|
print '<span class="websiteselection">';
|
||||||
|
|
||||||
print ' ';
|
// Edit web page properties
|
||||||
|
|
||||||
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'" name="editmeta">';
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editmeta&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</span></a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editmeta&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</span></a>';
|
||||||
|
|
||||||
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditHTMLSource")).'" name="editsource">';
|
// Edit HTML content
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editsource&token='.newToken().'" class="button bordertransp"'.$disabled.'>'.dol_escape_htmltag($langs->trans($conf->dol_optimize_smallscreen ? "HTML" : "EditHTMLSource")).'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editsource&token='.newToken().'" class="button bordertransp"'.$disabled.'>'.dol_escape_htmltag($langs->trans($conf->dol_optimize_smallscreen ? "HTML" : "EditHTMLSource")).'</a>';
|
||||||
print '</span>';
|
print '</span>';
|
||||||
|
|
||||||
|
|
||||||
|
// Switch include dynamic content / edit inline
|
||||||
print '<!-- button EditInLine and ShowSubcontainers -->'."\n";
|
print '<!-- button EditInLine and ShowSubcontainers -->'."\n";
|
||||||
print '<div class="websiteselectionsection inline-block">';
|
print '<div class="websiteselectionsection inline-block">';
|
||||||
|
|
||||||
@ -3210,7 +3291,19 @@ if (!GETPOST('hide_websitemenu')) {
|
|||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setashome&token='.newToken().'&website='.urlencode($website->ref).'&pageid='.((int) $pageid).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"></span></a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setashome&token='.newToken().'&website='.urlencode($website->ref).'&pageid='.((int) $pageid).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"></span></a>';
|
||||||
}
|
}
|
||||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("ClonePage")).'" name="createpagefromclone">';
|
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("ClonePage")).'" name="createpagefromclone">';
|
||||||
print '<input type="submit" class="buttonDelete bordertransp" name="delete" value="'.$langs->trans("Delete").'"'.($atleastonepage ? '' : ' disabled="disabled"').'>';
|
|
||||||
|
// Delete
|
||||||
|
//print '<input type="submit" class="buttonDelete bordertransp" name="delete" value="'.$langs->trans("Delete").'"'.($atleastonepage ? '' : ' disabled="disabled"').'>';
|
||||||
|
if ($websitepage->status == $websitepage::STATUS_DRAFT || !$atleastonepage) {
|
||||||
|
$disabled = ' disabled="disabled"';
|
||||||
|
$title = $langs->trans("WebpageMustBeDisabled", $langs->transnoentitiesnoconv($websitepage->LibStatut(0, 0)));
|
||||||
|
$url = '#';
|
||||||
|
} else {
|
||||||
|
$disabled = '';
|
||||||
|
$title = '';
|
||||||
|
$url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&website='.urlencode($website->ref);
|
||||||
|
}
|
||||||
|
print '<a href="'.$url.'" class="buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3466,13 +3559,16 @@ if ($action == 'editcss') {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Status of web site
|
// Status of web site
|
||||||
print '<!-- Status of website -->'."\n";
|
if ($action != 'createcontainer') {
|
||||||
print '<tr><td class="fieldrequired">';
|
if (empty($conf->use_javascript_ajax)) {
|
||||||
print $langs->trans('Status');
|
print '<!-- Status of web site page -->'."\n";
|
||||||
print '</td><td>';
|
print '<tr><td class="fieldrequired">';
|
||||||
print ajax_object_onoff($object, 'status', 'status', 'Enabled', 'Disabled');
|
print $langs->trans('Status');
|
||||||
//print dol_print_date($pagedatecreation, 'dayhour');
|
print '</td><td>';
|
||||||
print '</td></tr>';
|
print $form->selectyesno('status', $object->status);
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Main language
|
// Main language
|
||||||
print '<tr><td class="tdtop fieldrequired">';
|
print '<tr><td class="tdtop fieldrequired">';
|
||||||
@ -3851,7 +3947,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
|
|||||||
$pageusermodifid = $objectpage->fk_user_modif;
|
$pageusermodifid = $objectpage->fk_user_modif;
|
||||||
$pageauthoralias = $objectpage->author_alias;
|
$pageauthoralias = $objectpage->author_alias;
|
||||||
$pagestatus = $objectpage->status;
|
$pagestatus = $objectpage->status;
|
||||||
} else {
|
} else { // $action = 'createcontainer'
|
||||||
$type_container = 'page';
|
$type_container = 'page';
|
||||||
$pageurl = '';
|
$pageurl = '';
|
||||||
$pagealiasalt = '';
|
$pagealiasalt = '';
|
||||||
@ -3898,13 +3994,14 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action != 'createcontainer') {
|
if ($action != 'createcontainer') {
|
||||||
print '<!-- Status of page -->'."\n";
|
if (empty($conf->use_javascript_ajax)) {
|
||||||
print '<tr><td class="fieldrequired">';
|
print '<!-- Status of web site page -->'."\n";
|
||||||
print $langs->trans('Status');
|
print '<tr><td class="fieldrequired">';
|
||||||
print '</td><td>';
|
print $langs->trans('Status');
|
||||||
print ajax_object_onoff($objectpage, 'status', 'status', 'Enabled', 'Disabled');
|
print '</td><td>';
|
||||||
//print dol_print_date($pagedatecreation, 'dayhour');
|
print $form->selectyesno('status', $objectpage->status);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type of container
|
// Type of container
|
||||||
@ -3915,6 +4012,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
|
|||||||
$formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') ? GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') : $type_container), 0, '', 1);
|
$formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') ? GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') : $type_container), 0, '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Example/templates of page
|
||||||
if ($action == 'createcontainer') {
|
if ($action == 'createcontainer') {
|
||||||
print '<tr><td class="titlefield fieldrequired">';
|
print '<tr><td class="titlefield fieldrequired">';
|
||||||
print $langs->trans('WEBSITE_PAGE_EXAMPLE');
|
print $langs->trans('WEBSITE_PAGE_EXAMPLE');
|
||||||
@ -4149,6 +4247,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
if ($action == 'createcontainer') {
|
if ($action == 'createcontainer') {
|
||||||
print '<div class="center tablecheckboxcreatemanually'.$hiddenmanuallyafterload.'">';
|
print '<div class="center tablecheckboxcreatemanually'.$hiddenmanuallyafterload.'">';
|
||||||
|
|
||||||
@ -4177,7 +4276,10 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
|
|||||||
$arraygrabimagesinto = array('root'=>$langs->trans("WebsiteRootOfImages"), 'subpage'=>$langs->trans("SubdirOfPage"));
|
$arraygrabimagesinto = array('root'=>$langs->trans("WebsiteRootOfImages"), 'subpage'=>$langs->trans("SubdirOfPage"));
|
||||||
print $form->selectarray('grabimagesinto', $arraygrabimagesinto, GETPOSTISSET('grabimagesinto') ? GETPOST('grabimagesinto') : 'root', 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
print $form->selectarray('grabimagesinto', $arraygrabimagesinto, GETPOSTISSET('grabimagesinto') ? GETPOST('grabimagesinto') : 'root', 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<input class="button" style="margin-top: 5px" type="submit" name="fetchexternalurl" value="'.dol_escape_htmltag($langs->trans("FetchAndCreate")).'">';
|
|
||||||
|
print '<input class="button small" style="margin-top: 5px" type="submit" name="fetchexternalurl" value="'.dol_escape_htmltag($langs->trans("FetchAndCreate")).'">';
|
||||||
|
print '<input class="button button-cancel small" type="submit" name="preview" value="'.$langs->trans("Cancel").'">';
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,19 +63,22 @@ if (empty($action) && empty($id) && empty($ref)) {
|
|||||||
$action = 'view';
|
$action = 'view';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$result = restrictedArea($user, 'website', $id);
|
//$result = restrictedArea($user, 'website', $id);
|
||||||
|
if (empty($user->rights->websiteaccount->read)) {
|
||||||
|
accessforbidden('NotAllowed');
|
||||||
|
}
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
$permissionnote = $user->rights->websiteaccount->write; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->websiteaccount->write; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $user->rights->websiteaccount->write; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $user->rights->websiteaccount->write; // Used by the include of actions_dellink.inc.php
|
||||||
$permissiontoadd = $user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
$permissiontoadd = $user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
|
$permissiontodelete = $user->rights->websiteaccount->delete;
|
||||||
// Load object
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -320,8 +323,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($user->rights->website->delete) {
|
if ($permissiontodelete) {
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a></div>'."\n";
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
|
|||||||
@ -451,10 +451,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken().'&object=workstation">'.$langs->trans("ToClone").'</a>'."\n";
|
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=workstation', 'clone', $permissiontoadd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable / Enable
|
||||||
if ($permissiontoadd) {
|
if ($permissiontoadd) {
|
||||||
if ($object->status == $object::STATUS_ENABLED) {
|
if ($object->status == $object::STATUS_ENABLED) {
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable&token='.newToken().'">'.$langs->trans("Disable").'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable&token='.newToken().'">'.$langs->trans("Disable").'</a>'."\n";
|
||||||
@ -463,13 +463,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||||
if ($permissiontodelete) {
|
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
} else {
|
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -178,6 +178,9 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
|||||||
if (preg_match('/\/htdocs\/includes\//', $file['fullname'])) {
|
if (preg_match('/\/htdocs\/includes\//', $file['fullname'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (preg_match('/\/htdocs\/install\/doctemplates\/websites\//', $file['fullname'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (preg_match('/\/htdocs\/custom\//', $file['fullname'])) {
|
if (preg_match('/\/htdocs\/custom\//', $file['fullname'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -362,6 +362,12 @@ class DateLibTest extends PHPUnit\Framework\TestCase
|
|||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
|
||||||
|
// Check %Y-%m-%d %H:%M:%S format
|
||||||
|
$result=dol_print_date('1970-01-01', '%Y-%m-%d %H:%M:%S', true); // A case for compatibility check
|
||||||
|
print __METHOD__." result=".$result."\n";
|
||||||
|
$this->assertEquals('1970-01-01 00:00:00', $result);
|
||||||
|
|
||||||
|
|
||||||
// Check %Y-%m-%d %H:%M:%S format
|
// Check %Y-%m-%d %H:%M:%S format
|
||||||
$result=dol_print_date(0, '%Y-%m-%d %H:%M:%S', true);
|
$result=dol_print_date(0, '%Y-%m-%d %H:%M:%S', true);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user