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>';
|
||||
}
|
||||
|
||||
if ($user->hasRight('accounting', 'chartofaccount')) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
// Delete
|
||||
$permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
|
||||
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="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>';
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ if (empty($user->socid)) {
|
||||
}
|
||||
|
||||
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>';
|
||||
|
||||
@ -65,18 +65,21 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv("Bank");
|
||||
$help_url = '';
|
||||
$page_name = "BankSetupModule";
|
||||
|
||||
llxHeader('', $langs->trans("BankSetupModule"), $help_url);
|
||||
|
||||
|
||||
$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);
|
||||
|
||||
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';
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file admin/bankline_extrafields.php
|
||||
* \file htdocs/admin/bankline_extrafields.php
|
||||
* \ingroup bank
|
||||
* \brief Page to setup extra fields of bankline
|
||||
*/
|
||||
@ -41,7 +41,7 @@ $form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label = ExtraFields::$type2label;
|
||||
$type2label = [];
|
||||
$type2label = array();
|
||||
foreach ($tmptype2label as $key => $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');
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv("BankTransaction");
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -704,7 +704,7 @@ if (empty($reshook)) {
|
||||
|
||||
// Clone
|
||||
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
|
||||
@ -726,11 +726,8 @@ if (empty($reshook)) {
|
||||
}
|
||||
*/
|
||||
|
||||
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";
|
||||
}
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ function printDropdownBookmarksList()
|
||||
if ($sortorder) {
|
||||
$tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder);
|
||||
}
|
||||
if (is_array($_POST)) {
|
||||
if (!empty($_POST) && is_array($_POST)) {
|
||||
foreach ($_POST as $key => $val) {
|
||||
if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var))
|
||||
&& $val != ''
|
||||
|
||||
@ -2933,10 +2933,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($usercandelete) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'"';
|
||||
print '>'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2899,7 +2899,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
// Delete order
|
||||
if ($usercandelete) {
|
||||
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 {
|
||||
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) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$id.'">'.$langs->trans('Delete').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
$permissiontodelete = $user->rights->deplacement->supprimer;
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
@ -1677,10 +1677,8 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
|
||||
//if ($object->statut == Facture::STATUS_DRAFT && $user->rights->facture->supprimer)
|
||||
if ($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>';
|
||||
}
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->supprimer);
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -5744,8 +5744,7 @@ if ($action == 'create') {
|
||||
}
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteHref, '', $enableDelete, $params);
|
||||
} else {
|
||||
$params['attr']['title'] = $langs->trans('NotAllowed');
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', '', false, $params);
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', '', false);
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
@ -520,13 +520,7 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
|
||||
}
|
||||
|
||||
if ($user->socid == 0 && $action == '') {
|
||||
if ($user->rights->facture->paiement) {
|
||||
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 dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->paiement && !$disable_delete);
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -82,6 +82,7 @@ $usercanread = $user->rights->banque->cheque;
|
||||
$usercancreate = $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) {
|
||||
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>';
|
||||
|
||||
|
||||
@ -253,9 +253,9 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
||||
if ($action == '') {
|
||||
if ($user->rights->tax->charges->supprimer) {
|
||||
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 {
|
||||
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 ($user->rights->tax->charges->supprimer) {
|
||||
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 {
|
||||
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
|
||||
//$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
//$dolibarr_lib_TCPDF_PATH='/usr/share/php/tcpdf';
|
||||
//$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
|
||||
//$dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf';
|
||||
|
||||
@ -1579,7 +1579,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Delete
|
||||
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')) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
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) {
|
||||
$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
|
||||
$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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
// On peut supprimer entite si
|
||||
// - Droit de creer + mode brouillon (erreur creation)
|
||||
// - 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);
|
||||
}
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete, $params);
|
||||
}
|
||||
|
||||
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 $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)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$this->num = 0;
|
||||
|
||||
$atleastonepage = (is_array($website->lines) && count($website->lines) > 0);
|
||||
@ -239,13 +241,18 @@ class FormWebsite
|
||||
if ($atleastonepage && $action != 'editsource') {
|
||||
$out .= '<select name="'.$htmlname.'" id="'.$htmlname.'" class="maxwidth300'.($morecss ? ' '.$morecss : '').'">';
|
||||
} 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) {
|
||||
$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 (empty($pageid) && $action != 'createcontainer') { // Page id is not defined, we try to take one
|
||||
$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
|
||||
*
|
||||
* @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 $text_on Text if on
|
||||
* @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 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
|
||||
*/
|
||||
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;
|
||||
|
||||
if (empty($htmlname)) {
|
||||
$htmlname = $code;
|
||||
}
|
||||
|
||||
$out = '<script>
|
||||
$(function() {
|
||||
var input = '.json_encode($input).';
|
||||
|
||||
// Set constant
|
||||
$("#set_'.$code.'_'.$object->id.'").click(function() {
|
||||
$("#set_'.$htmlname.'_'.$object->id.'").click(function() {
|
||||
console.log("Click managed by ajax_object_onoff");
|
||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", {
|
||||
action: \'set\',
|
||||
field: \''.$field.'\',
|
||||
field: \''.dol_escape_js($field).'\',
|
||||
value: \'1\',
|
||||
element: \''.$object->element.'\',
|
||||
element: \''.dol_escape_js($object->element).'\',
|
||||
id: \''.$object->id.'\',
|
||||
token: \''.currentToken().'\'
|
||||
},
|
||||
function() {
|
||||
$("#set_'.$code.'_'.$object->id.'").hide();
|
||||
$("#del_'.$code.'_'.$object->id.'").show();
|
||||
$("#set_'.$htmlname.'_'.$object->id.'").hide();
|
||||
$("#del_'.$htmlname.'_'.$object->id.'").show();
|
||||
// Enable another element
|
||||
if (input.disabled && input.disabled.length > 0) {
|
||||
$.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_'.$code.'_'.$object->id.'").click(function() {
|
||||
$("#del_'.$htmlname.'_'.$object->id.'").click(function() {
|
||||
console.log("Click managed by ajax_object_onoff");
|
||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", {
|
||||
action: \'set\',
|
||||
field: \''.$field.'\',
|
||||
field: \''.dol_escape_js($field).'\',
|
||||
value: \'0\',
|
||||
element: \''.$object->element.'\',
|
||||
element: \''.dol_escape_js($object->element).'\',
|
||||
id: \''.$object->id.'\',
|
||||
token: \''.currentToken().'\'
|
||||
},
|
||||
function() {
|
||||
$("#del_'.$code.'_'.$object->id.'").hide();
|
||||
$("#set_'.$code.'_'.$object->id.'").show();
|
||||
$("#del_'.$htmlname.'_'.$object->id.'").hide();
|
||||
$("#set_'.$htmlname.'_'.$object->id.'").show();
|
||||
// Disable another element
|
||||
if (input.disabled && input.disabled.length > 0) {
|
||||
$.each(input.disabled, function(key,value) {
|
||||
@ -725,8 +730,8 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input =
|
||||
});
|
||||
});
|
||||
</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="del_'.$code.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? '' : 'hideobject').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_on), 'switch_on').'</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_'.$htmlname.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? '' : 'hideobject').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_on), 'switch_on').'</span>';
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -153,12 +153,12 @@ function bank_admin_prepare_head($object)
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin');
|
||||
|
||||
$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';
|
||||
$h++;
|
||||
|
||||
$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';
|
||||
$h++;
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.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 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
@ -2535,8 +2535,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
if ($tzoutput == 'tzserver') {
|
||||
$to_gmt = false;
|
||||
$offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion'
|
||||
$offsettz = 0; // Timezone offset with server timezone, so 0
|
||||
$offsetdst = 0; // Dst 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 (because to_gmt is false), so 0
|
||||
} elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') {
|
||||
$to_gmt = true;
|
||||
$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->setTimezone($user_date_tz);
|
||||
$user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : (int) $time);
|
||||
$offsettz = $user_dt->getOffset();
|
||||
} else { // old method (The 'tzuser' was processed like the 'tzuserrel')
|
||||
$offsettz = $user_dt->getOffset(); // should include dst ?
|
||||
} 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
|
||||
$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);
|
||||
}
|
||||
|
||||
$useadodb = getDolGlobalInt('MAIN_USE_LEGACY_ADODB_FOR_DATE', 0);
|
||||
//$useadodb = 1; // To switch to adodb
|
||||
|
||||
// Analyze date
|
||||
$reg = array();
|
||||
@ -2647,23 +2649,76 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
$ssec = (!empty($reg[6]) ? $reg[6] : '');
|
||||
|
||||
$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 {
|
||||
// Date is a timestamps
|
||||
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 {
|
||||
$ret = 'Bad value '.$time.' for date';
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
$month = adodb_strftime('%m', $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);
|
||||
$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'.
|
||||
if ($encodetooutput) {
|
||||
$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";
|
||||
$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);
|
||||
|
||||
$ret = str_replace('__A__', $dayweek, $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 = '')
|
||||
{
|
||||
//$datetimeobj = new DateTime('@'.$timestamp);
|
||||
$datetimeobj = new DateTime();
|
||||
$datetimeobj->setTimestamp($timestamp); // Use local PHP server timezone
|
||||
if ($forcetimezone) {
|
||||
@ -3189,7 +3256,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
|
||||
global $conf, $user, $langs, $mysoc, $hookmanager;
|
||||
|
||||
// Clean phone parameter
|
||||
$phone = preg_replace("/[\s.-]/", "", trim($phone));
|
||||
$phone = is_null($phone) ? '' : preg_replace("/[\s.-]/", "", trim($phone));
|
||||
if (empty($phone)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -563,7 +563,7 @@ function dolSaveLicense($file, $content)
|
||||
*/
|
||||
function showWebsiteTemplates(Website $website)
|
||||
{
|
||||
global $conf, $langs, $db, $form;
|
||||
global $conf, $langs, $db, $form, $user;
|
||||
|
||||
$dirthemes = array('/doctemplates/websites');
|
||||
if (!empty($conf->modules_parts['websitetemplates'])) { // Using this feature slow down application
|
||||
@ -582,11 +582,15 @@ function showWebsiteTemplates(Website $website)
|
||||
// Title
|
||||
print '<tr class="liste_titre"><th class="titlefield">';
|
||||
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 class="right">';
|
||||
$url = 'https://www.dolistore.com/43-web-site-templates';
|
||||
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 '</th></tr>';
|
||||
|
||||
@ -645,6 +649,9 @@ function showWebsiteTemplates(Website $website)
|
||||
print $subdir;
|
||||
print '<br>';
|
||||
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 '</div>';
|
||||
|
||||
|
||||
@ -214,9 +214,9 @@ print '<div class="tabsAction">';
|
||||
if (empty($action)) {
|
||||
if ($user->rights->don->supprimer) {
|
||||
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 {
|
||||
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
|
||||
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>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->ecm->setup);
|
||||
|
||||
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>';
|
||||
}
|
||||
|
||||
//if (count($filearrayall) == 0)
|
||||
//{
|
||||
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 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);
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -424,16 +424,9 @@ if ($action != 'edit') {
|
||||
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>';
|
||||
}
|
||||
/*
|
||||
if ($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 dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->ecm->setup);
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -238,12 +238,13 @@ if ($resql) {
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
// Delete
|
||||
if ($action == '') {
|
||||
if ($user->rights->expensereport->supprimer) {
|
||||
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 {
|
||||
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>';
|
||||
}
|
||||
|
||||
if ($user->rights->ficheinter->supprimer) {
|
||||
print '<div class="inline-block divButAction">';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$object->id.'">';
|
||||
print $langs->trans('Delete').'</a></div>';
|
||||
}
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->ficheinter->supprimer);
|
||||
|
||||
print '</div>';
|
||||
} else {
|
||||
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
|
||||
$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
|
||||
if (($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer) {
|
||||
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>';
|
||||
}
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1621,10 +1621,8 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
|
||||
//if ($object->statut == Facture::STATUS_DRAFT && ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer))
|
||||
if (($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>';
|
||||
}
|
||||
// Delete
|
||||
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>';
|
||||
|
||||
|
||||
@ -374,9 +374,9 @@ if ($result > 0) {
|
||||
if ($user->socid == 0 && $action == '') {
|
||||
if ($user->rights->fournisseur->facture->supprimer) {
|
||||
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 {
|
||||
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
|
||||
*/
|
||||
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="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>';
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
ADOdb Date Library, part of the ADOdb abstraction library
|
||||
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
|
||||
ADOdb Date Library, part of the ADOdb abstraction library
|
||||
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
|
||||
|
||||
PHP native date functions use integer timestamps for computations.
|
||||
Because of this, dates are restricted to the years 1901-2038 on Unix
|
||||
|
||||
@ -762,7 +762,7 @@ class JavascriptRenderer
|
||||
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 rtrim($root, '/') . "/$uri";
|
||||
@ -778,7 +778,7 @@ class JavascriptRenderer
|
||||
protected function filterAssetArray($array, $type = null)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
@ -558,7 +558,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
||||
}
|
||||
|
||||
$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') {
|
||||
$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
|
||||
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
|
||||
BanklineExtraFields=Bank Line Extrafields
|
||||
|
||||
@ -23,6 +23,7 @@ Language_da_DK=Danish
|
||||
Language_de_DE=German
|
||||
Language_de_AT=German (Austria)
|
||||
Language_de_CH=German (Switzerland)
|
||||
Language_de_LU=German (Luxembourg)
|
||||
Language_el_GR=Greek
|
||||
Language_el_CY=Greek (Cyprus)
|
||||
Language_en_AE=English (United Arab Emirates)
|
||||
|
||||
@ -66,7 +66,7 @@ ContractRefused=Contract refused
|
||||
RecruitmentCandidature=Application
|
||||
JobPositions=Job positions
|
||||
RecruitmentCandidatures=Applications
|
||||
InterviewToDo=Interview to do
|
||||
InterviewToDo=Contacts to follow
|
||||
AnswerCandidature=Application answer
|
||||
YourCandidature=Your application
|
||||
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)
|
||||
NextContainer=Next 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 (!$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 {
|
||||
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
|
||||
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) {
|
||||
@ -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)
|
||||
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
|
||||
// Delete
|
||||
$params = array();
|
||||
print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete, $params);
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
@ -678,7 +678,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
// Clone
|
||||
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
|
||||
@ -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)
|
||||
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";
|
||||
}
|
||||
|
||||
@ -61,6 +61,10 @@ $hookmanager->initHooks(array('surveycard', 'globalcard'));
|
||||
|
||||
$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">';
|
||||
|
||||
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>';
|
||||
|
||||
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>';
|
||||
}
|
||||
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>';
|
||||
}
|
||||
|
||||
//Delete button
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?suppressionsondage=1&action=delete&token='.newToken().'&id='.urlencode($numsondage).'">'.$langs->trans('Delete').'</a>';
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?suppressionsondage=1&id='.urlencode($numsondage).'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -417,17 +417,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
// Clone
|
||||
/*if ($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";
|
||||
if ($permissiontoadd) {
|
||||
//print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=inventory', 'clone', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
}
|
||||
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";
|
||||
}
|
||||
|
||||
if ($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";
|
||||
}
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->stock->supprimer);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
||||
$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
|
||||
$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
|
||||
$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
|
||||
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)
|
||||
if ($object->status < $object::STATUS_TRANSFERED && $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";
|
||||
}*/
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
@ -1401,7 +1401,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
// Delete
|
||||
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)) {
|
||||
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 {
|
||||
print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
||||
}
|
||||
|
||||
@ -674,14 +674,15 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($user->rights->projet->supprimer) {
|
||||
$permissiontodelete = $user->hasRight('projet', 'supprimer');
|
||||
if ($permissiontodelete) {
|
||||
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 {
|
||||
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 {
|
||||
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>';
|
||||
|
||||
@ -127,7 +127,7 @@ class RecruitmentCandidature extends CommonObject
|
||||
'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,),
|
||||
'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'),
|
||||
'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,),
|
||||
|
||||
@ -526,7 +526,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Back to draft
|
||||
if ($object->status == $object::STATUS_VALIDATED) {
|
||||
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
|
||||
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
|
||||
@ -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)
|
||||
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";
|
||||
}
|
||||
|
||||
@ -435,7 +435,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
// Clone
|
||||
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)
|
||||
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";
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
||||
$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
|
||||
|
||||
$permissiontodelete = $user->rights->resource->delete;
|
||||
|
||||
|
||||
/*
|
||||
@ -349,12 +349,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) {
|
||||
}
|
||||
}
|
||||
if ($action != "delete" && $action != "create" && $action != "edit") {
|
||||
// Delete resource
|
||||
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 dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
@ -251,9 +251,9 @@ print '<div class="tabsAction">';
|
||||
if ($action == '') {
|
||||
if ($user->rights->salaries->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 {
|
||||
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) {
|
||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans('Delete'), null, 'errors');
|
||||
setEventMessages($langs->trans('RecordDeleted'), null, 'errors');
|
||||
}
|
||||
$action = '';
|
||||
}
|
||||
|
||||
@ -2003,10 +2003,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Delete
|
||||
if (($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>';
|
||||
}
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', ($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -285,7 +285,7 @@ section.setupsection {
|
||||
div.tabBar textarea:focus {
|
||||
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 {
|
||||
/* div.tabBar input:focus, div.tabBar select:focus { */
|
||||
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);
|
||||
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;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
cursor: auto;
|
||||
text-decoration: none;
|
||||
}
|
||||
.buttonRefused {
|
||||
pointer-events: none;
|
||||
@ -5141,7 +5142,7 @@ tr.visible {
|
||||
.websiteformtoolbar {
|
||||
position: sticky;
|
||||
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 {
|
||||
|
||||
@ -4996,7 +4996,7 @@ tr.visible {
|
||||
.websiteformtoolbar {
|
||||
position: sticky;
|
||||
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 {
|
||||
|
||||
@ -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)
|
||||
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";
|
||||
}
|
||||
|
||||
@ -875,10 +875,10 @@ class Website extends CommonObject
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
//$langs->load("mymodule");
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline');
|
||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline');
|
||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online');
|
||||
}
|
||||
|
||||
$statusType = 'status5';
|
||||
|
||||
@ -838,10 +838,10 @@ class WebsitePage extends CommonObject
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
//$langs->load("mymodule");
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline');
|
||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline');
|
||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online');
|
||||
}
|
||||
|
||||
$statusType = 'status5';
|
||||
|
||||
@ -420,6 +420,18 @@ if ($action == 'renamefile') { // Must be after include DOL_DOCUMENT_ROOT.'/core
|
||||
$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') {
|
||||
dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1);
|
||||
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings');
|
||||
@ -449,6 +461,35 @@ if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && !$searc
|
||||
$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
|
||||
if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
|
||||
$error = 0;
|
||||
@ -487,7 +528,8 @@ if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $us
|
||||
// Now we reload list
|
||||
$listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters, -1);
|
||||
}
|
||||
// Set category
|
||||
|
||||
// Del category
|
||||
if ($massaction == 'delcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
|
||||
$error = 0;
|
||||
$nbupdate = 0;
|
||||
@ -2720,6 +2762,11 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
}
|
||||
$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;
|
||||
print '<div class="centpercent websitebar'.(GETPOST('dol_openinpopup', 'aZ09') ? ' hidden' : '').'">';
|
||||
@ -2730,28 +2777,25 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
|
||||
print '<!-- Bar for website -->';
|
||||
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 '</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>';
|
||||
|
||||
$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
|
||||
print '<span class="websiteselection">';
|
||||
print '<span class="websiteselection nopaddingrightimp">';
|
||||
|
||||
$out = '';
|
||||
$out .= '<select name="website" class="minwidth100 width200 maxwidth150onsmartphone" id="website">';
|
||||
if (empty($object->records)) {
|
||||
$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
|
||||
$i = 0;
|
||||
foreach ($object->records as $key => $valwebsite) {
|
||||
@ -2792,16 +2836,40 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
}
|
||||
print $out;
|
||||
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshsite" value="'.$langs->trans("Load").'">';
|
||||
print '</span>';
|
||||
|
||||
// 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')) {
|
||||
print ' ';
|
||||
|
||||
//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>';
|
||||
// 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>';
|
||||
|
||||
// Import web site
|
||||
$importlabel = $langs->trans("ImportSite");
|
||||
$exportlabel = $langs->trans("ExportSite");
|
||||
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"'.$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">';
|
||||
|
||||
// Clone web site
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
||||
|
||||
// Delete website
|
||||
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 {
|
||||
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
|
||||
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
|
||||
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>';
|
||||
}
|
||||
|
||||
@ -2940,53 +3015,64 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
print '<!-- Bar for websitepage -->';
|
||||
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 '</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 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') {
|
||||
$out = '';
|
||||
$s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'minwidth100 maxwidth200onsmartphone');
|
||||
|
||||
$s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'maxwidth200onsmartphone');
|
||||
$out .= '<span class="websiteselection nopaddingrightimp">';
|
||||
$out .= $s;
|
||||
$out .= '</span>';
|
||||
|
||||
if ($formwebsite->num > 0) {
|
||||
$out .= '<span class="websiteselection">';
|
||||
$out .= $s;
|
||||
$out .= '</span>';
|
||||
$urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref);
|
||||
|
||||
$urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref);
|
||||
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
$out .= '<script type="text/javascript">';
|
||||
$out .= 'jQuery(document).ready(function () {';
|
||||
$out .= ' jQuery("#pageid").change(function () {';
|
||||
$out .= ' console.log("We select "+jQuery("#pageid option:selected").val());';
|
||||
$out .= ' if (jQuery("#pgeid option:selected").val() == \'-2\') {';
|
||||
$out .= ' window.location.href = "'.$urltocreatenewpage.'";';
|
||||
$out .= ' } else {';
|
||||
$out .= ' window.location.href = "'.$_SERVER["PHP_SELF"].'?website='.urlencode($website->ref).'&pageid="+jQuery("#pageid option:selected").val();';
|
||||
$out .= ' }';
|
||||
$out .= ' });';
|
||||
$out .= '});';
|
||||
$out .= '</script>';
|
||||
}
|
||||
}
|
||||
|
||||
print $out;
|
||||
} else {
|
||||
print $langs->trans("New");
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
$out .= '<script type="text/javascript">';
|
||||
$out .= 'jQuery(document).ready(function () {';
|
||||
$out .= ' jQuery("#pageid").change(function () {';
|
||||
$out .= ' console.log("We select "+jQuery("#pageid option:selected").val());';
|
||||
$out .= ' if (jQuery("#pageid option:selected").val() == \'-2\') {';
|
||||
$out .= ' window.location.href = "'.$urltocreatenewpage.'";';
|
||||
$out .= ' } else {';
|
||||
$out .= ' window.location.href = "'.$_SERVER["PHP_SELF"].'?website='.urlencode($website->ref).'&pageid="+jQuery("#pageid option:selected").val();';
|
||||
$out .= ' }';
|
||||
$out .= ' });';
|
||||
$out .= '});';
|
||||
$out .= '</script>';
|
||||
}
|
||||
|
||||
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 '<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
|
||||
$pagepreviousid = 0;
|
||||
@ -3015,23 +3101,18 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
}
|
||||
|
||||
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 {
|
||||
print '<span class="valignmiddle opacitymedium">'.img_previous($langs->trans("PreviousContainer")).'</span>';
|
||||
}
|
||||
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 {
|
||||
print '<span class="valignmiddle opacitymedium">'.img_next($langs->trans("NextContainer")).'</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') {
|
||||
$disabled = '';
|
||||
if (empty($user->rights->website->write)) {
|
||||
@ -3109,15 +3190,15 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
|
||||
print '<span class="websiteselection">';
|
||||
|
||||
print ' ';
|
||||
|
||||
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'" name="editmeta">';
|
||||
// Edit web page properties
|
||||
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 '</span>';
|
||||
|
||||
|
||||
// Switch include dynamic content / edit inline
|
||||
print '<!-- button EditInLine and ShowSubcontainers -->'."\n";
|
||||
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 '<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>';
|
||||
|
||||
// Status of web site
|
||||
print '<!-- Status of website -->'."\n";
|
||||
print '<tr><td class="fieldrequired">';
|
||||
print $langs->trans('Status');
|
||||
print '</td><td>';
|
||||
print ajax_object_onoff($object, 'status', 'status', 'Enabled', 'Disabled');
|
||||
//print dol_print_date($pagedatecreation, 'dayhour');
|
||||
print '</td></tr>';
|
||||
if ($action != 'createcontainer') {
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<!-- Status of web site page -->'."\n";
|
||||
print '<tr><td class="fieldrequired">';
|
||||
print $langs->trans('Status');
|
||||
print '</td><td>';
|
||||
print $form->selectyesno('status', $object->status);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Main language
|
||||
print '<tr><td class="tdtop fieldrequired">';
|
||||
@ -3851,7 +3947,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
|
||||
$pageusermodifid = $objectpage->fk_user_modif;
|
||||
$pageauthoralias = $objectpage->author_alias;
|
||||
$pagestatus = $objectpage->status;
|
||||
} else {
|
||||
} else { // $action = 'createcontainer'
|
||||
$type_container = 'page';
|
||||
$pageurl = '';
|
||||
$pagealiasalt = '';
|
||||
@ -3898,13 +3994,14 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
|
||||
}
|
||||
|
||||
if ($action != 'createcontainer') {
|
||||
print '<!-- Status of page -->'."\n";
|
||||
print '<tr><td class="fieldrequired">';
|
||||
print $langs->trans('Status');
|
||||
print '</td><td>';
|
||||
print ajax_object_onoff($objectpage, 'status', 'status', 'Enabled', 'Disabled');
|
||||
//print dol_print_date($pagedatecreation, 'dayhour');
|
||||
print '</td></tr>';
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<!-- Status of web site page -->'."\n";
|
||||
print '<tr><td class="fieldrequired">';
|
||||
print $langs->trans('Status');
|
||||
print '</td><td>';
|
||||
print $form->selectyesno('status', $objectpage->status);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
print '</td></tr>';
|
||||
|
||||
// Example/templates of page
|
||||
if ($action == 'createcontainer') {
|
||||
print '<tr><td class="titlefield fieldrequired">';
|
||||
print $langs->trans('WEBSITE_PAGE_EXAMPLE');
|
||||
@ -4149,6 +4247,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
if ($action == 'createcontainer') {
|
||||
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"));
|
||||
print $form->selectarray('grabimagesinto', $arraygrabimagesinto, GETPOSTISSET('grabimagesinto') ? GETPOST('grabimagesinto') : 'root', 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
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 '</table>';
|
||||
}
|
||||
|
||||
@ -63,19 +63,22 @@ if (empty($action) && empty($id) && empty($ref)) {
|
||||
$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
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
//if ($user->socid > 0) $socid = $user->socid;
|
||||
//$result = restrictedArea($user, 'website', $id);
|
||||
if (empty($user->rights->websiteaccount->read)) {
|
||||
accessforbidden('NotAllowed');
|
||||
}
|
||||
|
||||
// Permissions
|
||||
$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
|
||||
$permissiontoadd = $user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||
|
||||
$permissiontodelete = $user->rights->websiteaccount->delete;
|
||||
|
||||
|
||||
/*
|
||||
@ -320,8 +323,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
*/
|
||||
|
||||
if ($user->rights->website->delete) {
|
||||
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";
|
||||
if ($permissiontodelete) {
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
}
|
||||
}
|
||||
print '</div>'."\n";
|
||||
|
||||
@ -451,10 +451,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
// Clone
|
||||
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 ($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";
|
||||
@ -463,13 +463,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
||||
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";
|
||||
}
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
@ -178,6 +178,9 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
||||
if (preg_match('/\/htdocs\/includes\//', $file['fullname'])) {
|
||||
continue;
|
||||
}
|
||||
if (preg_match('/\/htdocs\/install\/doctemplates\/websites\//', $file['fullname'])) {
|
||||
continue;
|
||||
}
|
||||
if (preg_match('/\/htdocs\/custom\//', $file['fullname'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -362,6 +362,12 @@ class DateLibTest extends PHPUnit\Framework\TestCase
|
||||
$langs=$this->savlangs;
|
||||
$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
|
||||
$result=dol_print_date(0, '%Y-%m-%d %H:%M:%S', true);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user