Merge remote-tracking branch 'upstream/develop' into 17b11
This commit is contained in:
commit
49a2e95bff
42
ChangeLog
42
ChangeLog
@ -32,6 +32,48 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Tables llx_prelevement_facture and llx_prelevement_facture_demande have been renamed into llx_prelevement and llx_prelevement_demande.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 16.0.2 compared to 16.0.1 *****
|
||||
|
||||
FIX: 16.0 - computed extrafields are not displayed if the object has no other extrafields
|
||||
FIX: #22538
|
||||
FIX: Accountancy - Review of Winfic - eWinfic - Winsis compta export format
|
||||
FIX: add loadRoleMode on getlinearray
|
||||
FIX: Autosearch on takepos was broken
|
||||
FIX: avoid access forbidden with numeric ref
|
||||
FIX: avoid error, check of product fetch is already check before
|
||||
FIX: avoid error, fetch of product is mandatory (by id or by ref)
|
||||
FIX: avoid unnecessary multiple calculation (#22637)
|
||||
FIX: bug on selected value for select_bom() function
|
||||
FIX: can not set prospect status "Do not contact"
|
||||
FIX: change in the communication status of the prospect
|
||||
FIX: check $id, already checked before
|
||||
FIX: closed warehouse for shipping
|
||||
FIX: extrafields_add tpl for stock movement
|
||||
FIX: the request SQL for transversal user, the join on usergroup table must be with getEntity('usergroup')
|
||||
FIX: Import of contact when there is duplicate thirdparties
|
||||
FIX: Import of socialnetwork field
|
||||
FIX: input selector is wrong with PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES usage
|
||||
FIX: install wizard error management
|
||||
FIX: just add integer
|
||||
FIX: Missing $object for online signature link build
|
||||
FIX: missing quote
|
||||
FIX: only modify hidden checkbox/multislected extrafields on update if they are provided in request
|
||||
FIX: php doc
|
||||
FIX: private message ticket become public if edit action
|
||||
FIX: remove > 0 and -1
|
||||
FIX: remove db object to avoid error with postgresql
|
||||
FIX: Search ambigous field on MO list
|
||||
FIX: Search on social networks
|
||||
FIX: Subscription must be stopped when max of attendees reached.
|
||||
FIX: supplier price update: missing error reporting
|
||||
FIX: travis & stickler feedbacks
|
||||
FIX: we must be able to select only bom of a specific product + several fixes on select_bom() function
|
||||
FIX: wrong perm check
|
||||
FIX: wrong typo, remove quote
|
||||
FIX: wrong var typo
|
||||
|
||||
|
||||
***** ChangeLog for 16.0.1 compared to 16.0.0 *****
|
||||
|
||||
FIX: #16476 on massaction the pdf generation is not using the t…
|
||||
|
||||
@ -113,15 +113,17 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S
|
||||
</script>';
|
||||
}
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial);
|
||||
|
||||
if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) {
|
||||
print info_admin($langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices"));
|
||||
print "<br>";
|
||||
}
|
||||
|
||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
if ($user->hasRight('accounting', 'chartofaccount')) {
|
||||
print "<br>\n"; print "<br>\n";
|
||||
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
|
||||
@ -314,7 +314,7 @@ print load_fiche_titre($langs->trans("PDFAddressForging"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td class="">'.$langs->trans("Parameter").'</td><td></td></tr>';
|
||||
|
||||
// Show sender name
|
||||
|
||||
@ -378,6 +378,7 @@ if ($conf->use_javascript_ajax) {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_NO_RECIPENT_FRAME", $arrval, $conf->global->MAIN_PDF_NO_RECIPENT_FRAME);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
//Invert sender and recipient
|
||||
|
||||
|
||||
@ -1091,7 +1091,7 @@ if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
print '</table>';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||
print '<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||
$datem = $db->jdate($obj->dv);
|
||||
print '<td class="center tddate" title="'.dol_escape_htmltag($langs->trans("DateValue").': '.dol_print_date($datem, 'day', 'tzserver')).'">';
|
||||
print dol_print_date($datem, 'day', 'tzserver');
|
||||
|
||||
@ -124,7 +124,7 @@ class box_services_contracts extends ModeleBoxes
|
||||
$contractlinestatic->label = $objp->label;
|
||||
$contractlinestatic->description = $objp->description;
|
||||
$contractlinestatic->type = $objp->type;
|
||||
$contractlinestatic->product_id = $objp->product_id;
|
||||
$contractlinestatic->fk_product = $objp->product_id;
|
||||
$contractlinestatic->product_ref = $objp->product_ref;
|
||||
$contractlinestatic->product_type = $objp->product_type;
|
||||
$contractlinestatic->statut = $objp->contractline_status;
|
||||
|
||||
@ -1942,7 +1942,7 @@ class ExtraFields
|
||||
* Return HTML string to print separator extrafield
|
||||
*
|
||||
* @param string $key Key of attribute
|
||||
* @param string $object Object
|
||||
* @param object $object Object
|
||||
* @param int $colspan Value of colspan to use (it must includes the first column with title)
|
||||
* @param string $display_type "card" for form display, "line" for document line display (extrafields on propal line, order line, etc...)
|
||||
* @param string $mode Show output ('view') or input ('create' or 'edit') for extrafield
|
||||
|
||||
@ -3679,7 +3679,11 @@ class Form
|
||||
$sql .= " AND p.tobuy = 1";
|
||||
$sql .= " AND s.fournisseur = 1";
|
||||
$sql .= " AND p.rowid = ".((int) $productid);
|
||||
$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
|
||||
if (empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED)) {
|
||||
$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
|
||||
} else {
|
||||
$sql .= " ORDER BY pfp.unitprice ASC";
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@ -3701,7 +3705,7 @@ class Form
|
||||
|
||||
$opt = '<option value="'.$objp->idprodfournprice.'"';
|
||||
//if there is only one supplier, preselect it
|
||||
if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier)) {
|
||||
if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && !empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED))) {
|
||||
$opt .= ' selected';
|
||||
}
|
||||
$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
|
||||
|
||||
@ -1417,6 +1417,9 @@ class FormTicket
|
||||
$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':''));
|
||||
print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
|
||||
print '<label for="send_msg_email">'.$langs->trans('SendMessageByEmail').'</label>';
|
||||
$texttooltip = $langs->trans("TicketMessageSendEmailHelp", '{s1}');
|
||||
$texttooltip = str_replace('{s1}', $langs->trans('MarkMessageAsPrivate'), $texttooltip);
|
||||
print ' '.$form->textwithpicto('', $texttooltip, 1, 'help');
|
||||
print '</td></tr>';
|
||||
|
||||
// Private message (not visible by customer/external user)
|
||||
|
||||
@ -173,6 +173,7 @@ class Utils
|
||||
}
|
||||
|
||||
if ($count > 0) {
|
||||
$langs->load("admin");
|
||||
$this->output = $langs->trans("PurgeNDirectoriesDeleted", $countdeleted);
|
||||
if ($count > $countdeleted) {
|
||||
$this->output .= '<br>'.$langs->trans("PurgeNDirectoriesFailed", ($count - $countdeleted));
|
||||
|
||||
@ -1810,7 +1810,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di
|
||||
/**
|
||||
* Show tab header of a card
|
||||
*
|
||||
* @param array $links Array of tabs. Currently initialized by calling a function xxx_admin_prepare_head
|
||||
* @param array $links Array of tabs (0=>url, 1=>label, 2=>code, 3=>not used, 4=>text after link, 5=>morecssonlink). Currently initialized by calling a function xxx_admin_prepare_head. Note that label into $links[$i][1] must be already HTML escaped.
|
||||
* @param string $active Active tab name (document', 'info', 'ldap', ....)
|
||||
* @param string $title Title
|
||||
* @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after)
|
||||
@ -1831,7 +1831,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0
|
||||
/**
|
||||
* Show tabs of a record
|
||||
*
|
||||
* @param array $links Array of tabs. Note that label into $links[$i][1] must be already HTML escaped.
|
||||
* @param array $links Array of tabs (0=>url, 1=>label, 2=>code, 3=>not used, 4=>text after link, 5=>morecssonlink). Currently initialized by calling a function xxx_admin_prepare_head. Note that label into $links[$i][1] must be already HTML escaped.
|
||||
* @param string $active Active tab name
|
||||
* @param string $title Title
|
||||
* @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after), -3=-2+'noborderbottom'
|
||||
@ -1934,7 +1934,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
|
||||
$out .= '<div class="tab tab'.($isactive?'active':'unactive').'" style="margin: 0 !important">';
|
||||
if (!empty($links[$i][0])) {
|
||||
$titletoshow = preg_replace('/<.*$/', '', $links[$i][1]);
|
||||
$out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tab inline-block valignmiddle'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'" title="'.dol_escape_htmltag($titletoshow).'">';
|
||||
$out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tab inline-block valignmiddle'.($morecss ? ' '.$morecss : '').($links[$i][5] ? ' '.$links[$i][5] : '').'" href="'.$links[$i][0].'" title="'.dol_escape_htmltag($titletoshow).'">';
|
||||
}
|
||||
$out .= $links[$i][1];
|
||||
if (!empty($links[$i][0])) {
|
||||
@ -3853,10 +3853,11 @@ function isValidPhone($phone)
|
||||
* @param int $nbofchar Nb of characters to keep
|
||||
* @return string Return first chars.
|
||||
*/
|
||||
function dolGetFirstLetters($s, $nbofchar = 1) {
|
||||
function dolGetFirstLetters($s, $nbofchar = 1)
|
||||
{
|
||||
$ret = '';
|
||||
$tmparray = explode(' ', $s);
|
||||
foreach($tmparray as $tmps) {
|
||||
foreach ($tmparray as $tmps) {
|
||||
$ret .= dol_substr($tmps, 0, $nbofchar);
|
||||
}
|
||||
|
||||
@ -5746,7 +5747,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
|
||||
if ((string) $forcerounding != '-1') {
|
||||
if ($forcerounding == 'MU') {
|
||||
$nbdecimal = $conf->global->MAIN_MAX_DECIMALS_UNIT;
|
||||
} else if ($forcerounding == 'MT') {
|
||||
} elseif ($forcerounding == 'MT') {
|
||||
$nbdecimal = $conf->global->MAIN_MAX_DECIMALS_TOT;
|
||||
} elseif ($forcerounding >= 0) {
|
||||
$nbdecimal = $forcerounding;
|
||||
|
||||
@ -53,11 +53,19 @@ function product_prepare_head($object)
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
if (!empty($object->status) && $usercancreadprice) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("SellingPrices");
|
||||
$head[$h][2] = 'price';
|
||||
$h++;
|
||||
if (!empty($object->status)) {
|
||||
if ($usercancreadprice) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("SellingPrices");
|
||||
$head[$h][2] = 'price';
|
||||
$h++;
|
||||
} else {
|
||||
$head[$h][0] = '#';
|
||||
$head[$h][1] = $langs->trans("SellingPrices");
|
||||
$head[$h][2] = 'price';
|
||||
$head[$h][5] = 'disabled';
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($object->status_buy) || (isModEnabled('margin') && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase
|
||||
@ -69,6 +77,12 @@ function product_prepare_head($object)
|
||||
$head[$h][1] = $langs->trans("BuyingPrices");
|
||||
$head[$h][2] = 'suppliers';
|
||||
$h++;
|
||||
} else {
|
||||
$head[$h][0] = '#';
|
||||
$head[$h][1] = $langs->trans("BuyingPrices");
|
||||
$head[$h][2] = 'suppliers';
|
||||
$head[$h][5] = 'disabled';
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1051,239 +1051,6 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output a task line into a pertime intput mode
|
||||
*
|
||||
* @param string $inc Line number (start to 0, then increased by recursive call)
|
||||
* @param string $parent Id of parent task to show (0 to show all)
|
||||
* @param User|null $fuser Restrict list to user if defined
|
||||
* @param Task[] $lines Array of lines
|
||||
* @param int $level Level (start to 0, then increased/decrease by recursive call)
|
||||
* @param string $projectsrole Array of roles user has on project
|
||||
* @param string $tasksrole Array of roles user has on task
|
||||
* @param string $mine Show only task lines I am assigned to
|
||||
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
|
||||
* @param int $preselectedday Preselected day
|
||||
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
|
||||
* @param int $oldprojectforbreak Old project id of last project break
|
||||
* @return array Array with time spent for $fuser for each day of week on tasks in $lines and substasks
|
||||
*/
|
||||
function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0)
|
||||
{
|
||||
global $conf, $db, $user, $langs;
|
||||
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
|
||||
|
||||
$lastprojectid = 0;
|
||||
$totalforeachline = array();
|
||||
$workloadforid = array();
|
||||
$lineswithoutlevel0 = array();
|
||||
|
||||
$numlines = count($lines);
|
||||
|
||||
// Create a smaller array with sublevels only to be used later. This increase dramatically performances.
|
||||
if ($parent == 0) { // Always and only if at first level
|
||||
for ($i = 0; $i < $numlines; $i++) {
|
||||
if ($lines[$i]->fk_task_parent) {
|
||||
$lineswithoutlevel0[] = $lines[$i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($oldprojectforbreak)) {
|
||||
$oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : -1); // 0 to start break , -1 no break
|
||||
}
|
||||
|
||||
//dol_syslog('projectLinesPerDay inc='.$inc.' preselectedday='.$preselectedday.' task parent id='.$parent.' level='.$level." count(lines)=".$numlines." count(lineswithoutlevel0)=".count($lineswithoutlevel0));
|
||||
for ($i = 0; $i < $numlines; $i++) {
|
||||
if ($parent == 0) {
|
||||
$level = 0;
|
||||
}
|
||||
|
||||
//if ($lines[$i]->fk_task_parent == $parent)
|
||||
//{
|
||||
// If we want all or we have a role on task, we show it
|
||||
if (empty($mine) || !empty($tasksrole[$lines[$i]->id])) {
|
||||
//dol_syslog("projectLinesPerWeek Found line ".$i.", a qualified task (i have role or want to show all tasks) with id=".$lines[$i]->id." project id=".$lines[$i]->fk_project);
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid) {
|
||||
$lastprojectid = $lines[$i]->fk_project;
|
||||
if ($preselectedday) {
|
||||
$projectstatic->id = $lines[$i]->fk_project;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($workloadforid[$projectstatic->id])) {
|
||||
if ($preselectedday) {
|
||||
$projectstatic->loadTimeSpent($preselectedday, 0, $fuser->id); // Load time spent from table projet_task_time for the project into this->weekWorkLoad and this->weekWorkLoadPerTask for all days of a week
|
||||
$workloadforid[$projectstatic->id] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$projectstatic->id = $lines[$i]->fk_project;
|
||||
$projectstatic->ref = $lines[$i]->project_ref;
|
||||
$projectstatic->title = $lines[$i]->project_label;
|
||||
$projectstatic->public = $lines[$i]->public;
|
||||
$projectstatic->status = $lines[$i]->project_status;
|
||||
|
||||
$taskstatic->id = $lines[$i]->task_id;
|
||||
$taskstatic->ref = ($lines[$i]->task_ref ? $lines[$i]->task_ref : $lines[$i]->task_id);
|
||||
$taskstatic->label = $lines[$i]->task_label;
|
||||
$taskstatic->date_start = $lines[$i]->date_start;
|
||||
$taskstatic->date_end = $lines[$i]->date_end;
|
||||
|
||||
$thirdpartystatic->id = $lines[$i]->socid;
|
||||
$thirdpartystatic->name = $lines[$i]->thirdparty_name;
|
||||
$thirdpartystatic->email = $lines[$i]->thirdparty_email;
|
||||
|
||||
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id)) {
|
||||
print '<tr class="oddeven trforbreak nobold">'."\n";
|
||||
print '<td colspan="11">';
|
||||
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
if ($projectstatic->title) {
|
||||
print ' - ';
|
||||
print $projectstatic->title;
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($oldprojectforbreak != -1) {
|
||||
$oldprojectforbreak = $projectstatic->id;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">'."\n";
|
||||
|
||||
// User
|
||||
/*
|
||||
print '<td class="nowrap">';
|
||||
print $fuser->getNomUrl(1, 'withproject', 'time');
|
||||
print '</td>';
|
||||
*/
|
||||
|
||||
// Project
|
||||
print "<td>";
|
||||
if ($oldprojectforbreak == -1) {
|
||||
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
print '<br>'.$projectstatic->title;
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Thirdparty
|
||||
print '<td class="tdoverflowmax100">';
|
||||
if ($thirdpartystatic->id > 0) {
|
||||
print $thirdpartystatic->getNomUrl(1, 'project', 10);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Ref
|
||||
print '<td>';
|
||||
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
||||
for ($k = 0; $k < $level; $k++) {
|
||||
print " ";
|
||||
}
|
||||
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
||||
// Label task
|
||||
print '<br>';
|
||||
for ($k = 0; $k < $level; $k++) {
|
||||
print " ";
|
||||
}
|
||||
print $taskstatic->label;
|
||||
//print "<br>";
|
||||
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
||||
print "</td>\n";
|
||||
|
||||
// Date
|
||||
print '<td class="center">';
|
||||
print dol_print_date($lines[$i]->timespent_datehour, 'day');
|
||||
print '</td>';
|
||||
|
||||
$disabledproject = 1;
|
||||
$disabledtask = 1;
|
||||
//print "x".$lines[$i]->fk_project;
|
||||
//var_dump($lines[$i]);
|
||||
//var_dump($projectsrole[$lines[$i]->fk_project]);
|
||||
// If at least one role for project
|
||||
if ($lines[$i]->public || !empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer) {
|
||||
$disabledproject = 0;
|
||||
$disabledtask = 0;
|
||||
}
|
||||
// If $restricteditformytask is on and I have no role on task, i disable edit
|
||||
if ($restricteditformytask && empty($tasksrole[$lines[$i]->id])) {
|
||||
$disabledtask = 1;
|
||||
}
|
||||
|
||||
// Hour
|
||||
print '<td class="nowrap center">';
|
||||
print dol_print_date($lines[$i]->timespent_datehour, 'hour');
|
||||
print '</td>';
|
||||
|
||||
$cssonholiday = '';
|
||||
if (!$isavailable[$preselectedday]['morning'] && !$isavailable[$preselectedday]['afternoon']) {
|
||||
$cssonholiday .= 'onholidayallday ';
|
||||
} elseif (!$isavailable[$preselectedday]['morning']) {
|
||||
$cssonholiday .= 'onholidaymorning ';
|
||||
} elseif (!$isavailable[$preselectedday]['afternoon']) {
|
||||
$cssonholiday .= 'onholidayafternoon ';
|
||||
}
|
||||
|
||||
// Duration
|
||||
print '<td class="duration'.($cssonholiday ? ' '.$cssonholiday : '').' center">';
|
||||
|
||||
$dayWorkLoad = $lines[$i]->timespent_duration;
|
||||
$totalforeachline[$preselectedday] += $lines[$i]->timespent_duration;
|
||||
|
||||
$alreadyspent = '';
|
||||
if ($dayWorkLoad > 0) {
|
||||
$alreadyspent = convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
|
||||
}
|
||||
|
||||
print convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin');
|
||||
|
||||
// Comment for avoid unnecessary multiple calculation
|
||||
/*$modeinput = 'hours';
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
print "jQuery(document).ready(function () {\n";
|
||||
print " jQuery('.inputhour, .inputminute').bind('keyup', function(e) { updateTotal(0, '".$modeinput."') });";
|
||||
print "})\n";
|
||||
print '</script>';*/
|
||||
|
||||
print '</td>';
|
||||
|
||||
// Note
|
||||
print '<td class="center">';
|
||||
print '<textarea name="'.$lines[$i]->id.'note" rows="'.ROWS_2.'" id="'.$lines[$i]->id.'note"'.($disabledtask ? ' disabled="disabled"' : '').'>';
|
||||
print $lines[$i]->timespent_note;
|
||||
print '</textarea>';
|
||||
print '</td>';
|
||||
|
||||
// Warning
|
||||
print '<td class="right">';
|
||||
/*if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject"));
|
||||
elseif ($disabledtask)
|
||||
{
|
||||
$titleassigntask = $langs->trans("AssignTaskToMe");
|
||||
if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...');
|
||||
|
||||
print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask));
|
||||
}*/
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
//$level--;
|
||||
//}
|
||||
}
|
||||
|
||||
return $totalforeachline;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output a task line into a pertime intput mode
|
||||
*
|
||||
|
||||
@ -59,7 +59,7 @@ function showOnlineSignatureUrl($type, $ref)
|
||||
*/
|
||||
function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1)
|
||||
{
|
||||
global $conf, $db, $langs, $dolibarr_main_url_root;
|
||||
global $conf, $object, $dolibarr_main_url_root;
|
||||
|
||||
$ref = str_replace(' ', '', $ref);
|
||||
$out = '';
|
||||
|
||||
@ -138,7 +138,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3102__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/list.php?mainmenu=products', 'List', 1, 'stocks', '$user->rights->stock->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/movement_list.php?mainmenu=products', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->lire', '', 2, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->supplier_order->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php?mainmenu=products', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php?mainmenu=products', 'MassStockTransferShort', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php?init=1&mainmenu=products', 'MassStockTransferShort', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __ENTITY__);
|
||||
|
||||
-- Product - Categories
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?mainmenu=products&leftmenu=cat&type=0', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
|
||||
|
||||
@ -2057,7 +2057,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
|
||||
$newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->hasRight('stock', 'lire'));
|
||||
$newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->hasRight('stock', 'mouvement', 'lire'));
|
||||
|
||||
$newmenu->add("/product/stock/massstockmove.php", $langs->trans("MassStockTransferShort"), 1, $user->hasRight('stock', 'mouvement', 'creer'));
|
||||
$newmenu->add("/product/stock/massstockmove.php?init=1", $langs->trans("MassStockTransferShort"), 1, $user->hasRight('stock', 'mouvement', 'creer'));
|
||||
if (isModEnabled('supplier_order')) {
|
||||
$newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire'));
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) {
|
||||
define('DOL_APPLICATION_TITLE', 'Dolibarr');
|
||||
}
|
||||
if (!defined('DOL_VERSION')) {
|
||||
define('DOL_VERSION', '17.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
define('DOL_VERSION', '17.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
}
|
||||
|
||||
if (!defined('EURO')) {
|
||||
|
||||
@ -2316,7 +2316,7 @@ UsePassword=Use a password
|
||||
UseOauth=Use a OAUTH token
|
||||
Images=Images
|
||||
MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form
|
||||
MaxNumberOfPostOnPublicPagesByIP=Max number of posts on public pages with an IP Address
|
||||
MaxNumberOfPostOnPublicPagesByIP=Max number of posts on public pages with the same IP address
|
||||
CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a thirdparty or contact from its phone number. URL to use is:
|
||||
ScriptIsEmpty=The script is empty
|
||||
ShowHideTheNRequests=Show/hide the %s SQL request(s)
|
||||
|
||||
@ -49,7 +49,7 @@ StockCorrection=Stock correction
|
||||
CorrectStock=Correct stock
|
||||
StockTransfer=Stock transfer
|
||||
TransferStock=Transfer stock
|
||||
MassStockTransferShort=Mass stock transfer
|
||||
MassStockTransferShort=Bulk stock change
|
||||
StockMovement=Stock movement
|
||||
StockMovements=Stock movements
|
||||
NumberOfUnit=Number of units
|
||||
@ -147,8 +147,9 @@ Replenishments=Replenishments
|
||||
NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s)
|
||||
NbOfProductAfterPeriod=Quantity of product %s in stock after selected period (> %s)
|
||||
MassMovement=Mass movement
|
||||
SelectProductInAndOutWareHouse=Select a source warehouse and a target warehouse, a product and a quantity then click "%s". Once this is done for all required movements, click on "%s".
|
||||
SelectProductInAndOutWareHouse=Select a source warehouse (optional), a target warehouse, a product and a quantity then click "%s". Once this is done for all required movements, click on "%s".
|
||||
RecordMovement=Record transfer
|
||||
RecordMovements=Record stock movements
|
||||
ReceivingForSameOrder=Receipts for this order
|
||||
StockMovementRecorded=Stock movements recorded
|
||||
RuleForStockAvailability=Rules on stock requirements
|
||||
|
||||
@ -241,6 +241,7 @@ TicketMessageMailIntroAutoNewPublicMessage=A new message was posted on the ticke
|
||||
TicketAssignedToYou=Ticket assigned
|
||||
TicketAssignedEmailBody=You have been assigned the ticket #%s by %s
|
||||
MarkMessageAsPrivate=Mark message as private
|
||||
TicketMessageSendEmailHelp=An email will be sent to all assigned contact (internal contacts, but also external contacts except if the option "%s" is checked)
|
||||
TicketMessagePrivateHelp=This message will not display to external users
|
||||
TicketEmailOriginIssuer=Issuer at origin of the tickets
|
||||
InitialMessage=Initial Message
|
||||
|
||||
@ -208,10 +208,16 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
|
||||
$mysoc = new Societe($db);
|
||||
$mysoc->setMysoc($conf);
|
||||
|
||||
// For some countries, we need to invert our address with customer address
|
||||
// We set some specific default values according to country
|
||||
|
||||
if ($mysoc->country_code == 'DE' && !isset($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
|
||||
// For DE, we need to invert our address with customer address
|
||||
$conf->global->MAIN_INVERT_SENDER_RECIPIENT = 1;
|
||||
}
|
||||
if ($mysoc->country_code == 'FR' && !isset($conf->global->MAIN_PROFID1_IN_ADDRESS)) {
|
||||
// For FR, default value of option to show profid SIRET is on by default
|
||||
$conf->global->MAIN_PROFID1_IN_ADDRESS = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -949,8 +949,8 @@ END;
|
||||
'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5),
|
||||
'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9),
|
||||
'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => isModEnabled('multicurrency'), 'checked'=>0, 'position'=>10),
|
||||
'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13),
|
||||
'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14),
|
||||
'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>-1, 'position'=>13),
|
||||
'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>-1, 'position'=>14),
|
||||
'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15),
|
||||
'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>16),
|
||||
'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked'=>0, 'position'=>17),
|
||||
|
||||
@ -422,7 +422,7 @@ $sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_u
|
||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||
$sql .= ' p.fk_unit, cu.label as cu_label,';
|
||||
}
|
||||
$sql .= ' MIN(pfp.unitprice) as minsellprice';
|
||||
$sql .= ' MIN(pfp.unitprice) as bestpurchaseprice';
|
||||
if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
|
||||
$sql .= ', pac.rowid as prod_comb_id';
|
||||
}
|
||||
@ -1727,8 +1727,7 @@ while ($i < min($num, $limit)) {
|
||||
// Better buy price
|
||||
if (!empty($arrayfields['p.minbuyprice']['checked'])) {
|
||||
print '<td class="right nowraponall">';
|
||||
if ($obj->tobuy && $obj->minsellprice != '' && $usercancreadprice) {
|
||||
//print price($obj->minsellprice).' '.$langs->trans("HT");
|
||||
if ($obj->tobuy && $obj->bestpurchaseprice != '' && $usercancreadprice) {
|
||||
if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) {
|
||||
if ($product_fourn->product_fourn_price_id > 0) {
|
||||
if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) {
|
||||
|
||||
@ -162,7 +162,7 @@ if ($resql) {
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("LastMovements", min($num, $max)).'</th>';
|
||||
print '<th>'.$langs->trans("Product").'</th>';
|
||||
if (isModEnabled('productbatch')) {
|
||||
@ -202,7 +202,7 @@ if ($resql) {
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowraponall">'.img_picto($langs->trans("Ref").' '.$objp->mid, 'movement', 'class="pictofixedwidth"').dol_print_date($db->jdate($objp->datem), 'dayhour').'</td>';
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $producttmp->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
if (isModEnabled('productbatch')) {
|
||||
@ -216,7 +216,7 @@ if ($resql) {
|
||||
print '<td>'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
|
||||
}*/
|
||||
}
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $warehouse->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td class="right">';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2021 Laurent Destaileur <ely@users.sourceforge.net>
|
||||
/* Copyright (C) 2013-2022 Laurent Destaileur <ely@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Regis Houssin <regis.houssin@inodbox.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@ -77,6 +77,9 @@ if (!$sortorder) {
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (GETPOST('init')) {
|
||||
unset($_SESSION['massstockmove']);
|
||||
}
|
||||
$listofdata = array();
|
||||
if (!empty($_SESSION['massstockmove'])) {
|
||||
$listofdata = json_decode($_SESSION['massstockmove'], true);
|
||||
@ -88,13 +91,12 @@ if (!empty($_SESSION['massstockmove'])) {
|
||||
*/
|
||||
|
||||
if ($action == 'addline' && !empty($user->rights->stock->mouvement->creer)) {
|
||||
if (!($id_product > 0)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors');
|
||||
}
|
||||
if (!($id_sw > 0)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WarehouseSource")), null, 'errors');
|
||||
//$error++;
|
||||
//setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WarehouseSource")), null, 'errors');
|
||||
if ($id_sw < 0) {
|
||||
$id_sw = 0;
|
||||
}
|
||||
}
|
||||
if (!($id_tw > 0)) {
|
||||
$error++;
|
||||
@ -105,6 +107,10 @@ if ($action == 'addline' && !empty($user->rights->stock->mouvement->creer)) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorWarehouseMustDiffers"), null, 'errors');
|
||||
}
|
||||
if (!($id_product > 0)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors');
|
||||
}
|
||||
if (!$qty) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors');
|
||||
@ -132,6 +138,7 @@ if ($action == 'addline' && !empty($user->rights->stock->mouvement->creer)) {
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($_SESSION['massstockmove']);exit;
|
||||
if (!$error) {
|
||||
if (count(array_keys($listofdata)) > 0) {
|
||||
$id = max(array_keys($listofdata)) + 1;
|
||||
@ -197,20 +204,22 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree
|
||||
|
||||
//print 'price src='.$pricesrc.', price dest='.$pricedest;exit;
|
||||
|
||||
if (empty($conf->productbatch->enabled) || !$product->hasbatch()) { // If product does not need lot/serial
|
||||
// Remove stock
|
||||
$result1 = $product->correct_stock(
|
||||
$user,
|
||||
$id_sw,
|
||||
$qty,
|
||||
1,
|
||||
GETPOST("label"),
|
||||
$pricesrc,
|
||||
GETPOST("codemove")
|
||||
);
|
||||
if ($result1 < 0) {
|
||||
$error++;
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
if (empty($conf->productbatch->enabled) || !$product->hasbatch()) { // If product does not need lot/serial
|
||||
// Remove stock if source warehouse defined
|
||||
if ($id_sw > 0) {
|
||||
$result1 = $product->correct_stock(
|
||||
$user,
|
||||
$id_sw,
|
||||
$qty,
|
||||
1,
|
||||
GETPOST("label"),
|
||||
$pricesrc,
|
||||
GETPOST("codemove")
|
||||
);
|
||||
if ($result1 < 0) {
|
||||
$error++;
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Add stock
|
||||
@ -244,21 +253,23 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree
|
||||
}
|
||||
|
||||
// Remove stock
|
||||
$result1 = $product->correct_stock_batch(
|
||||
$user,
|
||||
$id_sw,
|
||||
$qty,
|
||||
1,
|
||||
GETPOST("label"),
|
||||
$pricesrc,
|
||||
$dlc,
|
||||
$dluo,
|
||||
$batch,
|
||||
GETPOST("codemove")
|
||||
);
|
||||
if ($result1 < 0) {
|
||||
$error++;
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
if ($id_sw > 0) {
|
||||
$result1 = $product->correct_stock_batch(
|
||||
$user,
|
||||
$id_sw,
|
||||
$qty,
|
||||
1,
|
||||
GETPOST("label"),
|
||||
$pricesrc,
|
||||
$dlc,
|
||||
$dluo,
|
||||
$batch,
|
||||
GETPOST("codemove")
|
||||
);
|
||||
if ($result1 < 0) {
|
||||
$error++;
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Add stock
|
||||
@ -285,6 +296,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree
|
||||
}
|
||||
}
|
||||
}
|
||||
//var_dump($_SESSION['massstockmove']);exit;
|
||||
|
||||
if (!$error) {
|
||||
unset($_SESSION['massstockmove']);
|
||||
@ -465,9 +477,9 @@ llxHeader('', $title, $help_url);
|
||||
print load_fiche_titre($langs->trans("MassStockTransferShort"), '', 'stock');
|
||||
|
||||
$titletoadd = $langs->trans("Select");
|
||||
$buttonrecord = $langs->trans("RecordMovement");
|
||||
$buttonrecord = $langs->trans("RecordMovements");
|
||||
$titletoaddnoent = $langs->transnoentitiesnoconv("Select");
|
||||
$buttonrecordnoent = $langs->transnoentitiesnoconv("RecordMovement");
|
||||
$buttonrecordnoent = $langs->transnoentitiesnoconv("RecordMovements");
|
||||
print '<span class="opacitymedium">'.$langs->trans("SelectProductInAndOutWareHouse", $titletoaddnoent, $buttonrecordnoent).'</span><br>';
|
||||
|
||||
print '<br>';
|
||||
@ -569,25 +581,25 @@ $param = '';
|
||||
print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
print getTitleFieldOfList($langs->trans('WarehouseTarget'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
print getTitleFieldOfList($langs->trans('Product'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
if (isModEnabled('productbatch')) {
|
||||
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
}
|
||||
print getTitleFieldOfList($langs->trans('Qty'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'center tagtd maxwidthonsmartphone ');
|
||||
print getTitleFieldOfList($langs->trans('Qty'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right tagtd maxwidthonsmartphone ');
|
||||
print getTitleFieldOfList('', 0);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
// From warehouse
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
print img_picto($langs->trans("WarehouseSource"), 'stock', 'class="paddingright"').$formproduct->selectWarehouses($id_sw, 'id_sw', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200');
|
||||
print '</td>';
|
||||
// To warehouse
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
print img_picto($langs->trans("WarehouseTarget"), 'stock', 'class="paddingright"').$formproduct->selectWarehouses($id_tw, 'id_tw', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200');
|
||||
print '</td>';
|
||||
// Product
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
$filtertype = 0;
|
||||
if (!empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
$filtertype = '';
|
||||
@ -603,13 +615,13 @@ print $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, -
|
||||
print '</td>';
|
||||
// Batch number
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
print img_picto($langs->trans("LotSerial"), 'lot', 'class="paddingright"');
|
||||
print '<input type="text" name="batch" class="flat maxwidth50" value="'.dol_escape_htmltag($batch).'">';
|
||||
print '<input type="text" name="batch" class="flat maxwidth75" value="'.dol_escape_htmltag($batch).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Qty
|
||||
print '<td class="center"><input type="text" class="flat maxwidth50" name="qty" value="'.price2num((float) $qty, 'MS').'"></td>';
|
||||
print '<td class="right"><input type="text" class="flat maxwidth50 right" name="qty" value="'.price2num((float) $qty, 'MS').'"></td>';
|
||||
// Button to add line
|
||||
print '<td class="right"><input type="submit" class="button" name="addline" value="'.dol_escape_htmltag($titletoadd).'"></td>';
|
||||
|
||||
@ -617,18 +629,25 @@ print '</tr>';
|
||||
|
||||
foreach ($listofdata as $key => $val) {
|
||||
$productstatic->fetch($val['id_product']);
|
||||
$warehousestatics->fetch($val['id_sw']);
|
||||
$warehousestatict->fetch($val['id_tw']);
|
||||
|
||||
$warehousestatics->id = 0;
|
||||
$warehousestatict->id = 0;
|
||||
if ($val['id_sw'] > 0) {
|
||||
$warehousestatics->fetch($val['id_sw']);
|
||||
}
|
||||
if ($val['id_tw'] > 0) {
|
||||
$warehousestatict->fetch($val['id_tw']);
|
||||
}
|
||||
|
||||
if ($productstatic->id <= 0) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ObjectNotFound", $langs->transnoentitiesnoconv("Product")), null, 'errors');
|
||||
}
|
||||
if ($warehousestatics->id <= 0) {
|
||||
if ($warehousestatics->id < 0) { // We accept 0 for source warehouse id
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ObjectNotFound", $langs->transnoentitiesnoconv("WarehouseSource")), null, 'errors');
|
||||
}
|
||||
if ($warehousestatics->id <= 0) {
|
||||
if ($warehousestatict->id <= 0) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ObjectNotFound", $langs->transnoentitiesnoconv("WarehouseTarget")), null, 'errors');
|
||||
}
|
||||
@ -636,7 +655,13 @@ foreach ($listofdata as $key => $val) {
|
||||
if (!$error) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $warehousestatics->getNomUrl(1);
|
||||
if ($warehousestatics->id > 0) {
|
||||
print $warehousestatics->getNomUrl(1);
|
||||
} else {
|
||||
print '<span class="opacitymedium">';
|
||||
print $langs->trans("None");
|
||||
print '</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $warehousestatict->getNomUrl(1);
|
||||
@ -649,7 +674,7 @@ foreach ($listofdata as $key => $val) {
|
||||
print dol_escape_htmltag($val['batch']);
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="center">'.price2num((float) $val['qty'], 'MS').'</td>';
|
||||
print '<td class="right">'.price2num((float) $val['qty'], 'MS').'</td>';
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=delline&token='.newToken().'&idline='.$val['id'].'">'.img_delete($langs->trans("Remove")).'</a></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@ -670,7 +695,7 @@ if (count($listofdata)) {
|
||||
|
||||
// Button to record mass movement
|
||||
$codemove = (GETPOSTISSET("codemove") ? GETPOST("codemove", 'alpha') : dol_print_date(dol_now(), '%Y%m%d%H%M%S'));
|
||||
$labelmovement = GETPOST("label") ? GETPOST('label') : $langs->trans("StockTransfer").' '.dol_print_date($now, '%Y-%m-%d %H:%M');
|
||||
$labelmovement = GETPOST("label") ? GETPOST('label') : $langs->trans("MassStockTransferShort").' '.dol_print_date($now, '%Y-%m-%d %H:%M');
|
||||
|
||||
print '<div class="center">';
|
||||
print '<span class="fieldrequired">'.$langs->trans("InventoryCode").':</span> ';
|
||||
@ -696,6 +721,7 @@ if ($action == 'delete') {
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
|
||||
/**
|
||||
* Verify if $haystack startswith $needle
|
||||
*
|
||||
|
||||
@ -600,7 +600,6 @@ if (!empty($conf->project->enabled)) {
|
||||
}
|
||||
|
||||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.tosell, p.tobuy, p.tobatch, p.fk_product_type as type, p.entity,";
|
||||
$sql .= " e.ref as warehouse_ref, e.rowid as entrepot_id, e.lieu, e.fk_parent, e.statut,";
|
||||
$sql .= " m.rowid as mid, m.value as qty, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,";
|
||||
@ -691,32 +690,6 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
/* If a group by is required
|
||||
$sql .= " GROUP BY ";
|
||||
foreach($object->fields as $key => $val) {
|
||||
$sql .= "t.".$key.", ";
|
||||
}
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||
}
|
||||
}
|
||||
// Add where from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
*/
|
||||
|
||||
// Add HAVING from hooks
|
||||
/*
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint;
|
||||
*/
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
@ -1369,7 +1342,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
print '<tr class="oddeven">';
|
||||
// Id movement
|
||||
if (!empty($arrayfields['m.rowid']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
|
||||
print $obj->mid;
|
||||
print '</td>'; // This is primary not movement id
|
||||
|
||||
@ -1325,7 +1325,7 @@ while ($i < $imaxinloop) {
|
||||
}
|
||||
// Sales Representatives
|
||||
if (!empty($arrayfields['commercial']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if ($obj->socid) {
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
|
||||
@ -104,14 +104,16 @@ if ($type == 'global') {
|
||||
$errmsg .= $project->error;
|
||||
$errors = array_merge($errors, $project->errors);
|
||||
} else {
|
||||
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."projet";
|
||||
$sql .= " WHERE ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee = ".((int) $project->id);
|
||||
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
|
||||
$sql .= " WHERE fk_project = ".((int) $project->id);
|
||||
|
||||
$resql = $db->query($resql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
$currentnbofattendees = $obj->nb;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,8 +163,17 @@ if (empty($reshook)) {
|
||||
// Le premier contact trouvé est utilisé pour déterminer le contact suivi
|
||||
$contacts = $object->searchContactByEmail($origin_email);
|
||||
|
||||
// Ensure that contact is active and select first active contact
|
||||
$cid = -1;
|
||||
foreach ($contacts as $key => $contact) {
|
||||
if ((int) $contact->statut == 1) {
|
||||
$cid = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Option to require email exists to create ticket
|
||||
if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && !$contacts[0]->socid) {
|
||||
if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && ($cid < 0 || empty($contacts[$cid]->socid))) {
|
||||
$error++;
|
||||
array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket"));
|
||||
$action = '';
|
||||
@ -314,9 +323,9 @@ if (empty($reshook)) {
|
||||
$object->fk_soc = $searched_companies[0]->id;
|
||||
}
|
||||
|
||||
if (is_array($contacts) && count($contacts) > 0) {
|
||||
$object->fk_soc = $contacts[0]->socid;
|
||||
$usertoassign = $contacts[0]->id;
|
||||
if (is_array($contacts) && count($contacts) > 0 && $cid >= 0) {
|
||||
$object->fk_soc = $contacts[$cid]->socid;
|
||||
$usertoassign = $contacts[$cid]->id;
|
||||
}
|
||||
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
|
||||
@ -1119,10 +1119,12 @@ while ($i < min($num, $limit)) {
|
||||
// Type ent
|
||||
if (!empty($arrayfields['typent.code']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if (count($typenArray) == 0) {
|
||||
if (!isset($typenArray) || empty($typenArray)) {
|
||||
$typenArray = $formcompany->typent_array(1);
|
||||
}
|
||||
print $typenArray[$obj->typent_code];
|
||||
if (isset($typenArray[$obj->typent_code])) {
|
||||
print $typenArray[$obj->typent_code];
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@ -1966,7 +1966,7 @@ td.showDragHandle {
|
||||
.side-nav-vert {
|
||||
position: sticky;
|
||||
top: 0px;
|
||||
z-index: 1001;
|
||||
z-index: 1005;
|
||||
}
|
||||
<?php } ?>
|
||||
<?php if (!empty($conf->global->THEME_DARKMODEENABLED)) { ?>
|
||||
@ -2536,6 +2536,12 @@ span.mainmenuaspan.tmenudisabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
a.disabled {
|
||||
color: #aaa;
|
||||
text-decoration: none !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active {
|
||||
padding: 0px 2px 0px 2px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
@ -5354,10 +5360,17 @@ td.cal_other_month {
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Ajax - Liste deroulante de l'autocompletion */
|
||||
/* Ajax - Combo list for autocompletion */
|
||||
/* ============================================================================== */
|
||||
|
||||
.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff !important; }
|
||||
.ui-widget-content {
|
||||
border: solid 1px rgba(0,0,0,.3);
|
||||
background: var(--colorbackbody) !important;
|
||||
color: var(--colortext) !important;
|
||||
}
|
||||
/*.ui-widget-header {
|
||||
background: var(--colorbacktitle);
|
||||
}*/
|
||||
|
||||
.ui-autocomplete-loading { background: white url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/working.gif', 1) ?>) right center no-repeat; }
|
||||
.ui-autocomplete {
|
||||
@ -6454,7 +6467,7 @@ ul.select2-results__options li {
|
||||
min-width: 220px !important;
|
||||
}
|
||||
.onrightofpage span.select2-dropdown.ui-dialog.select2-dropdown--below {
|
||||
min-width: 140px !important;
|
||||
min-width: 140px !important;
|
||||
}
|
||||
|
||||
.select2-container--open .select2-dropdown--below {
|
||||
|
||||
@ -297,17 +297,17 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
|
||||
}
|
||||
.member-company-back {
|
||||
padding: 2px 7px 2px 7px;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
white-space: nowrap;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.member-individual-back {
|
||||
padding: 2px 7px 2px 7px;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
white-space: nowrap;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -50,17 +50,17 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
|
||||
}
|
||||
.member-company-back {
|
||||
padding: 2px 7px 2px 7px;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
white-space: nowrap;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.member-individual-back {
|
||||
padding: 2px 7px 2px 7px;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
white-space: nowrap;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.bg-infobox-project{
|
||||
|
||||
@ -2118,7 +2118,7 @@ body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block
|
||||
.side-nav-vert {
|
||||
position: sticky;
|
||||
top: 0px;
|
||||
z-index: 1001;
|
||||
z-index: 1005;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
@ -2586,6 +2586,12 @@ span.mainmenuaspan.tmenudisabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
a.disabled {
|
||||
color: #aaa;
|
||||
text-decoration: none !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active {
|
||||
font-weight: normal;
|
||||
padding: 0px 5px 0px 5px;
|
||||
@ -5188,10 +5194,14 @@ td.cal_other_month {
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Ajax - Liste deroulante de l'autocompletion */
|
||||
/* Ajax - Combo list for autocompletion */
|
||||
/* ============================================================================== */
|
||||
|
||||
.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff !important; }
|
||||
.ui-widget-content {
|
||||
border: solid 1px rgba(0,0,0,.3);
|
||||
background: var(--colorbackbody) !important;
|
||||
color: var(--colortext) !important;
|
||||
}
|
||||
|
||||
.ui-autocomplete-loading { background: white url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/working.gif', 1) ?>) right center no-repeat; }
|
||||
.ui-autocomplete {
|
||||
@ -6222,7 +6232,7 @@ ul.select2-results__options li {
|
||||
min-width: 220px !important;
|
||||
}
|
||||
.onrightofpage span.select2-dropdown.ui-dialog.select2-dropdown--below {
|
||||
min-width: 140px !important;
|
||||
min-width: 140px !important;
|
||||
}
|
||||
|
||||
.select2-container--open .select2-dropdown--below {
|
||||
|
||||
@ -717,6 +717,7 @@ class User extends CommonObject
|
||||
'shipping' => 'expedition',
|
||||
'task' => 'task@projet',
|
||||
'fichinter' => 'ficheinter',
|
||||
'propale' => 'propal',
|
||||
'inventory' => 'stock',
|
||||
'invoice' => 'facture',
|
||||
'invoice_supplier' => 'fournisseur',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user