Merge remote-tracking branch 'Dolibarr/11.0' into 11
This commit is contained in:
commit
20fd489194
@ -26,9 +26,11 @@ FIX: missing global $conf
|
||||
FIX: Missing token in some forms (avoid unset POST errors)
|
||||
FIX: params of setEventMessage($langs->trans('ErrorProductClone')...
|
||||
FIX: Remove unexisting link
|
||||
FIX: mass action on stock movements
|
||||
FIX: substitute lines dates values on doc generator (ODT, ...)
|
||||
FIX: Ticket - Load Cache Messages Ticket, wrong message's status
|
||||
FIX: Ticket Public - Private messages are displayed
|
||||
FIX: wrong include - replace extrafields_create.tpl.php to extrafields_add.tpl.php
|
||||
|
||||
***** ChangeLog for 11.0.2 compared to 11.0.1 *****
|
||||
FIX: #10309
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# \file build/makepack-dolibarr.pl
|
||||
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
||||
# \author (c)2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
# \author (c)2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
#
|
||||
# This is list of constant you can set to have generated packages moved into a specific dir:
|
||||
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
|
||||
@ -430,12 +430,14 @@ if ($nboftargetok) {
|
||||
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
||||
print 'Run git push -f --tags'."\n";
|
||||
$ret=`git push -f --tags`;
|
||||
#$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'Run git push --tags'."\n";
|
||||
$ret=`git push --tags`;
|
||||
#$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`;
|
||||
}
|
||||
chdir("$olddir");
|
||||
}
|
||||
|
||||
@ -54,5 +54,5 @@ fi
|
||||
|
||||
echo Think to launch also:
|
||||
echo "> dev/tools/fixaltlanguages.sh fix all"
|
||||
echo "For v11: Replace also regex \(.*(sponge|cornas|eratosthene|cyan).*\) with ''"
|
||||
echo "For v11: Replace also regex \(.*(sponge|cornas|eratosthene|cyan).*\) with '' on *.lang files"
|
||||
|
||||
|
||||
@ -930,7 +930,7 @@ if ($mode == 'marketplace')
|
||||
|
||||
?>
|
||||
<form method="POST" class="centpercent" id="searchFormList" action="<?php echo $dolistore->url ?>">
|
||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken'] ?>">
|
||||
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
|
||||
<input type="hidden" name="mode" value="marketplace">
|
||||
<div class="divsearchfield"><?php echo $langs->trans('Keyword') ?>:
|
||||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Chercher un module') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br>
|
||||
|
||||
@ -992,7 +992,7 @@ else
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=settodraft&id='.$object->id.'">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
|
||||
if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer)
|
||||
if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer)
|
||||
{
|
||||
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING))
|
||||
{
|
||||
|
||||
@ -48,8 +48,8 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined,
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (!$sortfield) $sortfield = "email";
|
||||
if (!$sortorder) $sortorder = "ASC";
|
||||
if (!$sortfield) $sortfield = "mc.statut,email";
|
||||
if (!$sortorder) $sortorder = "DESC,ASC";
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
|
||||
@ -16,11 +16,17 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/**
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/accounting-files.php
|
||||
* \ingroup compta
|
||||
* \brief Page to show portoflio and files of a thirdparty and download it
|
||||
*/
|
||||
|
||||
if ($_GET['action'] == 'dl' || $_POST['action'] == 'dl') { // To not replace token when downloading file
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
|
||||
}
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -106,7 +112,7 @@ $error = 0;
|
||||
|
||||
$filesarray = array();
|
||||
$result = false;
|
||||
if (($action == "searchfiles" || $action == "dl")) {
|
||||
if (($action == 'searchfiles' || $action == 'dl')) {
|
||||
if (empty($date_start))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart")), null, 'errors');
|
||||
@ -235,7 +241,7 @@ if (($action == "searchfiles" || $action == "dl")) {
|
||||
{
|
||||
$result = true;
|
||||
|
||||
$files = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview\.png)$', '', SORT_ASC, 1);
|
||||
$files = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1);
|
||||
//var_dump($upload_dir);
|
||||
//var_dump($files);
|
||||
|
||||
@ -459,7 +465,7 @@ if (!empty($date_start) && !empty($date_stop))
|
||||
$param .= '&date_stopyear='.GETPOST('date_stopyear', 'int');
|
||||
|
||||
print '<form name="dl" action="?action=dl" method="POST" >'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="token" value="'.currentToken().'">';
|
||||
|
||||
echo dol_print_date($date_start, 'day')." - ".dol_print_date($date_stop, 'day');
|
||||
|
||||
|
||||
@ -1157,14 +1157,14 @@ if ($resql)
|
||||
} else {
|
||||
$color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR1;
|
||||
}
|
||||
$backgroundcolor = 'style="background-color: '.$color.';"';
|
||||
$backgroundcolor = 'style="background: '.$color.';"';
|
||||
} else {
|
||||
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) {
|
||||
$color = '#7fdb86';
|
||||
} else {
|
||||
$color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR2;
|
||||
}
|
||||
$backgroundcolor = 'style="background-color: '.$color.';"';
|
||||
$backgroundcolor = 'style="background: '.$color.';"';
|
||||
}
|
||||
}
|
||||
print '<tr class="oddeven" '.$backgroundcolor.'>';
|
||||
|
||||
@ -281,7 +281,7 @@ if ($action == 'create')
|
||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
||||
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
||||
print '</td></tr>';
|
||||
@ -293,7 +293,7 @@ if ($action == 'create')
|
||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
||||
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1699,7 +1699,17 @@ if (empty($reshook))
|
||||
$object->fk_facture_source = $_POST['situations'];
|
||||
$object->type = Facture::TYPE_SITUATION;
|
||||
|
||||
if (!empty($origin) && !empty($originid))
|
||||
|
||||
$object->retained_warranty = GETPOST('retained_warranty', 'int');
|
||||
$object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
|
||||
|
||||
$retained_warranty_date_limit = GETPOST('retained_warranty_date_limit');
|
||||
if (!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)) {
|
||||
$object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit);
|
||||
}
|
||||
$object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement);
|
||||
|
||||
if (!empty($origin) && !empty($originid))
|
||||
{
|
||||
$object->origin = $origin;
|
||||
$object->origin_id = $originid;
|
||||
@ -2541,7 +2551,12 @@ if (empty($reshook))
|
||||
$pa_ht = $originLine->pa_ht;
|
||||
$label = $originLine->label;
|
||||
$array_options = $originLine->array_options;
|
||||
$situation_percent = 100;
|
||||
if($object->type == Facture::TYPE_SITUATION){
|
||||
$situation_percent = 0;
|
||||
}
|
||||
else{
|
||||
$situation_percent = 100;
|
||||
}
|
||||
$fk_prev_id = '';
|
||||
$fk_unit = $originLine->fk_unit;
|
||||
$pu_ht_devise = $originLine->multicurrency_subprice;
|
||||
@ -3017,7 +3032,7 @@ if ($action == 'create')
|
||||
// First situation invoice
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp = '<input id="radio_situation" type="radio" name="type" value="5"'.(GETPOST('type') == 5 ? ' checked' : '').'> ';
|
||||
$tmp = $tmp.'<label for="radio_situation invoice" >'.$langs->trans("InvoiceFirstSituationAsk").'</label>';
|
||||
$tmp = $tmp.'<label for="radio_situation" >'.$langs->trans("InvoiceFirstSituationAsk").'</label>';
|
||||
$desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
print '</div></div>';
|
||||
@ -3304,14 +3319,28 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
$retained_warranty = GETPOST('retained_warranty', 'int');
|
||||
$retained_warranty = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
|
||||
if(empty($retained_warranty)){
|
||||
if(!empty($objectsrc->retained_warranty)){ // use previous situation value
|
||||
$retained_warranty = $objectsrc->retained_warranty;
|
||||
}else{
|
||||
$retained_warranty = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('RetainedWarranty').'</td><td colspan="2">';
|
||||
print '<input id="new-situation-invoice-retained-warranty" name="retained_warranty" type="number" value="'.$retained_warranty.'" step="0.01" min="0" max="100" />%';
|
||||
|
||||
// Retained warranty payment term
|
||||
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('PaymentConditionsShortRetainedWarranty').'</td><td colspan="2">';
|
||||
$retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
|
||||
$retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
||||
if(empty($retained_warranty_fk_cond_reglement)){
|
||||
$retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
||||
if(!empty($objectsrc->retained_warranty_fk_cond_reglement)){ // use previous situation value
|
||||
$retained_warranty_fk_cond_reglement = $objectsrc->retained_warranty_fk_cond_reglement;
|
||||
}else{
|
||||
$retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
||||
}
|
||||
}
|
||||
$form->select_conditions_paiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1052,6 +1052,11 @@ class Facture extends CommonInvoice
|
||||
$facture->situation_cycle_ref = $this->situation_cycle_ref;
|
||||
$facture->situation_final = $this->situation_final;
|
||||
|
||||
$facture->retained_warranty = $this->retained_warranty;
|
||||
$facture->retained_warranty_fk_cond_reglement = $this->retained_warranty_fk_cond_reglement;
|
||||
$facture->retained_warranty_date_limit = $this->retained_warranty_date_limit;
|
||||
|
||||
|
||||
// Loop on each line of new invoice
|
||||
foreach ($facture->lines as $i => $tmpline)
|
||||
{
|
||||
|
||||
@ -1215,6 +1215,8 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permissio
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Delete record from mass action (massaction = 'delete' for direct delete, action/confirm='delete'/'yes' with a confirmation step before)
|
||||
if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == 'yes')) && $permissiontodelete)
|
||||
{
|
||||
|
||||
@ -4086,7 +4086,7 @@ abstract class CommonObject
|
||||
*/
|
||||
public function printObjectLines($action, $seller, $buyer, $selected = 0, $dateSelector = 0, $defaulttpldir = '/core/tpl')
|
||||
{
|
||||
global $conf, $hookmanager, $langs, $user, $object, $form, $extrafields;
|
||||
global $conf, $hookmanager, $langs, $user, $form, $extrafields, $object;
|
||||
// TODO We should not use global var for this
|
||||
global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $outputalsopricetotalwithtax;
|
||||
|
||||
@ -4110,6 +4110,7 @@ abstract class CommonObject
|
||||
{
|
||||
// Output template part (modules that overwrite templates must declare this into descriptor)
|
||||
// Use global variables + $dateSelector + $seller and $buyer
|
||||
// Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook.
|
||||
$dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir));
|
||||
foreach ($dirtpls as $module => $reldir)
|
||||
{
|
||||
|
||||
@ -508,6 +508,7 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti
|
||||
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
|
||||
if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace))
|
||||
{
|
||||
$reg = array();
|
||||
$maxloop = 20; $loopnb = 0; // Protection against infinite loop
|
||||
while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
|
||||
{
|
||||
@ -5579,7 +5580,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1)
|
||||
$allowed_tags_string = '<'.$allowed_tags_string.'>';
|
||||
|
||||
if ($cleanalsosomestyles) {
|
||||
$stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless
|
||||
$stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to bypass this regex, the string must also be encoded by the dol_htmlentitiesbr during output so it become harmless
|
||||
}
|
||||
|
||||
$temp = strip_tags($stringtoclean, $allowed_tags_string);
|
||||
@ -8574,7 +8575,8 @@ function isAFileWithExecutableContent($filename)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return new session token
|
||||
* Return the value of token currently saved into session with name 'newtoken'.
|
||||
* This token must be send by any POST as it will be used by next page for comparison with value in session.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@ -8582,3 +8584,13 @@ function newToken()
|
||||
{
|
||||
return $_SESSION['newtoken'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of token currently saved into session with name 'token'.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function currentToken()
|
||||
{
|
||||
return $_SESSION['token'];
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ class modFacture extends DolibarrModules
|
||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'none.rest'=>'Rest',
|
||||
'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin',
|
||||
'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription",
|
||||
@ -303,7 +303,7 @@ class modFacture extends DolibarrModules
|
||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'none.rest'=>'Rest',
|
||||
'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin',
|
||||
'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef',
|
||||
|
||||
@ -66,11 +66,12 @@ $userstatic = new User($db);
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE CONTACTS -->
|
||||
<div class="underbanner clearboth"></div>
|
||||
<div class="div-table-responsive">
|
||||
<div class="tagtable tableforcontact centpercent noborder nobordertop allwidth">
|
||||
|
||||
<?php
|
||||
|
||||
print '<div class="underbanner clearboth"></div>'."\n";
|
||||
print '<div class="div-table-responsive">'."\n";
|
||||
print '<div class="tagtable tableforcontact centpercent noborder nobordertop allwidth">'."\n";
|
||||
|
||||
if ($permission) {
|
||||
?>
|
||||
<form class="tagtr liste_titre">
|
||||
|
||||
@ -113,8 +113,8 @@ if (empty($reshook))
|
||||
if (!$error)
|
||||
{
|
||||
$object->titre = GETPOST('nouveautitre', 'nohtml');
|
||||
$object->commentaires = GETPOST('nouveauxcommentaires', 'nohtml');
|
||||
$object->description = GETPOST('nouveauxcommentaires', 'nohtml');
|
||||
$object->commentaires = GETPOST('nouveauxcommentaires', 'restricthtml');
|
||||
$object->description = GETPOST('nouveauxcommentaires', 'restricthtml');
|
||||
$object->mail_admin = GETPOST('nouvelleadresse', 'alpha');
|
||||
$object->date_fin = $expiredate;
|
||||
$object->allow_comments = GETPOST('cancomment', 'alpha') == 'on' ? true : false;
|
||||
@ -208,6 +208,7 @@ $toutsujet = str_replace("@", "<br>", $toutsujet);
|
||||
$toutsujet = str_replace("°", "'", $toutsujet);
|
||||
|
||||
print '<form name="updatesurvey" action="'.$_SERVER["PHP_SELF"].'?id='.$numsondage.'" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
$head = opensurvey_prepare_head($object);
|
||||
@ -248,12 +249,12 @@ print '</td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="2">';
|
||||
if ($action == 'edit')
|
||||
{
|
||||
$doleditor = new DolEditor('nouveauxcommentaires', dol_htmlentities($object->commentaires), '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%');
|
||||
$doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%');
|
||||
$doleditor->Create(0, '');
|
||||
}
|
||||
else
|
||||
{
|
||||
print (dol_textishtml($object->commentaires) ? $object->commentaires : dol_nl2br($object->commentaires, 1, true));
|
||||
print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -263,7 +264,7 @@ if (!$object->fk_user_creat) {
|
||||
print '<tr><td>'.$langs->trans("EMail").'</td><td colspan="2">';
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<input type="text" name="nouvelleadresse" size="40" value="'.$object->mail_admin.'">';
|
||||
print '<input type="text" name="nouvelleadresse" class="minwith200" value="'.$object->mail_admin.'">';
|
||||
}
|
||||
else print dol_print_email($object->mail_admin, 0, 0, 1);
|
||||
print '</td></tr>';
|
||||
@ -395,6 +396,7 @@ print '<br>';
|
||||
|
||||
|
||||
print '<form name="formulaire5" action="#" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print load_fiche_titre($langs->trans("CommentsOfVoters"), '', '');
|
||||
|
||||
|
||||
@ -67,31 +67,70 @@ function opensurvey_prepare_head(Opensurveysondage $object)
|
||||
* @param int $disablehead More content into html header
|
||||
* @param array $arrayofjs Array of complementary js files
|
||||
* @param array $arrayofcss Array of complementary css files
|
||||
* @param string $numsondage Num survey
|
||||
* @return void
|
||||
*/
|
||||
function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '')
|
||||
function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $numsondage = '')
|
||||
{
|
||||
global $conf, $mysoc;
|
||||
global $conf, $langs, $mysoc;
|
||||
global $dolibarr_main_url_root;
|
||||
|
||||
//$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
|
||||
|
||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
||||
print '<body id="mainbody" class="publicnewmemberform" style="margin-top: 10px;">';
|
||||
print '<body id="mainbody" class="publicnewmemberform">';
|
||||
|
||||
// Print logo
|
||||
if ($mysoc->logo) {
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$urllogo && (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')))
|
||||
|
||||
print '<span id="dolpaymentspan"></span>'."\n";
|
||||
print '<div class="center">'."\n";
|
||||
print '<form name="formulaire" action="studs.php?sondage='.$numsondage.'"'.'#bas" method="POST">'."\n";
|
||||
print '<input type="hidden" name="sondage" value="'.$numsondage.'"/>';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
|
||||
print "\n";
|
||||
|
||||
|
||||
// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo)
|
||||
$width = 0;
|
||||
// Define logo and logosmall
|
||||
$logosmall = $mysoc->logo_small;
|
||||
$logo = $mysoc->logo;
|
||||
$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix;
|
||||
if (!empty($conf->global->$paramlogo)) $logosmall = $conf->global->$paramlogo;
|
||||
elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall = $conf->global->ONLINE_PAYMENT_LOGO;
|
||||
//print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
|
||||
// Define urllogo
|
||||
$urllogo = '';
|
||||
$urllogofull = '';
|
||||
if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
||||
$width = 150;
|
||||
}
|
||||
elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo))
|
||||
{
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
||||
$width = 150;
|
||||
}
|
||||
|
||||
print '<div style="text-align:center"><img alt="Logo" id="logosubscribe" title="" src="'.$urllogo.'"/></div>';
|
||||
print '<br>';
|
||||
// Output html code for logo
|
||||
if ($urllogo)
|
||||
{
|
||||
print '<div class="backgreypublicpayment">';
|
||||
print '<div class="logopublicpayment">';
|
||||
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
|
||||
if ($width) print ' width="'.$width.'"';
|
||||
print '>';
|
||||
print '</div>';
|
||||
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
|
||||
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<div style="margin-left: 50px; margin-right: 50px;">';
|
||||
print '<div style="margin-left: 50px; margin-right: 50px; text-align: start;"><br>';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,6 +141,8 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $
|
||||
function llxFooterSurvey()
|
||||
{
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
print '</div>';
|
||||
|
||||
printCommonFooter('public');
|
||||
|
||||
|
||||
@ -1093,6 +1093,6 @@ print '</form>'."\n";
|
||||
|
||||
print '<a name="bas"></a>'."\n";
|
||||
|
||||
llxFooterSurvey();
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -110,7 +110,7 @@ llxHeader('', $langs->trans("OpenSurvey"), "", '', 0, 0, $arrayofjs, $arrayofcss
|
||||
if (empty($_SESSION['titre']))
|
||||
{
|
||||
dol_print_error('', $langs->trans('ErrorOpenSurveyFillFirstSection'));
|
||||
llxFooterSurvey();
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -1134,4 +1134,17 @@ class MouvementStock extends CommonObject
|
||||
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete object in database
|
||||
*
|
||||
* @param User $user User that deletes
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = false)
|
||||
{
|
||||
return $this->deleteCommon($user, $notrigger);
|
||||
//return $this->deleteCommon($user, $notrigger, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,8 +54,11 @@ $ref = GETPOST('ref', 'alpha');
|
||||
$msid = GETPOST('msid', 'int');
|
||||
$product_id = GETPOST("product_id", 'int');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'movementlist';
|
||||
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||
|
||||
// Security check
|
||||
//$result=restrictedArea($user, 'stock', $id, 'entrepot&stock');
|
||||
@ -123,15 +126,19 @@ if (!$user->rights->stock->mouvement->lire) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$permissiontoread = $user->rights->stock->mouvement->lire;
|
||||
$permissiontoadd = $user->rights->stock->mouvement->creer;
|
||||
$permissiontodelete = $user->rights->stock->mouvement->creer; // There is no deletion permission for stock movement as we shoul dnever delete
|
||||
|
||||
$usercanread = $user->rights->stock->mouvement->lire;
|
||||
$usercancreate = $user->rights->stock->mouvement->creer;
|
||||
$usercandelete = $user->rights->stock->mouvement->creer;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$usercanread = (($user->rights->stock->mouvement->lire));
|
||||
$usercancreate = (($user->rights->stock->mouvement->creer));
|
||||
$usercandelete = (($user->rights->stock->mouvement->supprimer));
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
||||
|
||||
@ -139,26 +146,35 @@ $parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers
|
||||
if (empty($reshook))
|
||||
{
|
||||
$year = '';
|
||||
$month = '';
|
||||
$search_ref = '';
|
||||
$search_movement = "";
|
||||
$search_type_mouvement = "";
|
||||
$search_inventorycode = "";
|
||||
$search_product_ref = "";
|
||||
$search_product = "";
|
||||
$search_warehouse = "";
|
||||
$search_user = "";
|
||||
$search_batch = "";
|
||||
$search_qty = '';
|
||||
$sall = "";
|
||||
$toselect = '';
|
||||
$search_array_options = array();
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$year = '';
|
||||
$month = '';
|
||||
$search_ref = '';
|
||||
$search_movement = "";
|
||||
$search_type_mouvement = "";
|
||||
$search_inventorycode = "";
|
||||
$search_product_ref = "";
|
||||
$search_product = "";
|
||||
$search_warehouse = "";
|
||||
$search_user = "";
|
||||
$search_batch = "";
|
||||
$search_qty = '';
|
||||
$sall = "";
|
||||
$toselect = '';
|
||||
$search_array_options = array();
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass = 'MouvementStock';
|
||||
$objectlabel = 'MouvementStock';
|
||||
$uploaddir = $conf->stock->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
// Correct stock
|
||||
@ -600,8 +616,8 @@ if ($resql)
|
||||
$resqlbis = $db->query($sql);
|
||||
if ($resqlbis)
|
||||
{
|
||||
$obj = $db->fetch_object($resqlbis);
|
||||
$lastmovementdate = $db->jdate($obj->datem);
|
||||
$objbis = $db->fetch_object($resqlbis);
|
||||
$lastmovementdate = $db->jdate($objbis->datem);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -694,8 +710,9 @@ if ($resql)
|
||||
// 'presend'=>$langs->trans("SendByMail"),
|
||||
// 'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
//if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||
if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
|
||||
// By default, we should never accept deletion of stock movement.
|
||||
if (! empty($conf->global->STOCK_ALLOW_DELETE_OF_MOVEMENT) && $permissiontodelete) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -713,6 +730,13 @@ if ($resql)
|
||||
if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
|
||||
|
||||
// Add code for pre mass action (confirmation or email presend form)
|
||||
$topicmail = "SendStockMovement";
|
||||
$modelmail = "movementstock";
|
||||
$objecttmp = new MouvementStock($db);
|
||||
$trackid = 'mov'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
|
||||
@ -961,6 +985,8 @@ if ($resql)
|
||||
|
||||
$arrayofuniqueproduct = array();
|
||||
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
@ -1126,8 +1152,8 @@ if ($resql)
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
$selected = 0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
if (in_array($objp->mid, $arrayofselected)) $selected = 1;
|
||||
print '<input id="cb'.$objp->mid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objp->mid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
|
||||
@ -250,7 +250,8 @@ $form = new Form($db);
|
||||
|
||||
$arrayofjs = array();
|
||||
$arrayofcss = array('/opensurvey/css/style.css');
|
||||
llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss);
|
||||
|
||||
llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss, $numsondage);
|
||||
|
||||
if (empty($object->ref)) // For survey, id is a hex string
|
||||
{
|
||||
@ -274,6 +275,7 @@ foreach ($toutsujet as $value)
|
||||
$toutsujet = str_replace("°", "'", $toutsujet);
|
||||
|
||||
|
||||
|
||||
print '<div class="survey_invitation">'.$langs->trans("YouAreInivitedToVote").'</div>';
|
||||
print $langs->trans("OpenSurveyHowTo").'<br><br>';
|
||||
|
||||
@ -301,9 +303,6 @@ if (!$canbemodified) {
|
||||
exit;
|
||||
}
|
||||
|
||||
print '<form name="formulaire" action="studs.php?sondage='.$numsondage.'"'.'#bas" method="POST">'."\n";
|
||||
print '<input type="hidden" name="sondage" value="'.$numsondage.'"/>';
|
||||
|
||||
print '<div class="cadre"> '."\n";
|
||||
print '<br><br>'."\n";
|
||||
|
||||
|
||||
@ -1559,7 +1559,7 @@ else
|
||||
|
||||
// Other attributes
|
||||
$parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_create.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
|
||||
// Assign a sale representative
|
||||
print '<tr>';
|
||||
|
||||
@ -3397,6 +3397,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
|
||||
print '<td class="tdoverflow100">'.$answerrecord->description.'</td>';
|
||||
print '<td>';
|
||||
$param = '?action=replacesiteconfirm';
|
||||
$param .= '&websiteid='.$website->id;
|
||||
$param .= '&optioncontent='.GETPOST('optioncontent');
|
||||
$param .= '&optionmeta='.GETPOST('optionmeta');
|
||||
$param .= '&optionsitefiles='.GETPOST('optionsitefiles');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user