Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop

This commit is contained in:
Maxime Kohlhaas 2013-04-22 16:38:13 +02:00
commit a747ef6939
19 changed files with 332 additions and 298 deletions

View File

@ -4,6 +4,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.4 compared to 3.3.2 *****
For users:
- New: Can use ODS templates as document templates.
- New: Add link to autofill/reset with quantity to ship when creating a
delivery receipt.
- New: Event into calendar use different colors for different users.
@ -11,46 +12,48 @@ For users:
- New: Add a tab "consumption" on thirdparties to list products bought/sells.
- New: Some performance enhancements.
- New: Can attach files onto trip and expenses modules.
- New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR.
- New: Add hidden option MAIN_PDF_TITLE_BACKGROUND_COLOR.
- New: Merge tab customer and prospect.
- New: Add ES formated address country rule.
- New: Can define a hierarchical responsible on user.
- New: Add a hierarchical view for users.
- New: Can define a hierarchical responsible on user and add a tree view to
see hierarchy of users.
- New: Can expand/collapse menus, categories and users list.
- New: extra parameters are supported into ODT templates.
- New: total per vat rate are available as tags for ODT templates.
- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices).
- New: extra parameters are supported into ODT/ODS templates.
- New: total per vat rate are available as tags for ODT/ODS templates.
- New: Some part of interface use more CSS3 (ie: agenda)
- New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice.
- New: [ task #707 ] Create option "ProfIdx is mandatory to validate a invoice".
- New: Can define if we want to use VAT or not for subscriptions (foundation module).
- New: Can define a default choice for choice "More action when recording
a subscription" (foundation module).
- New: Add link to check professional id for india.
- New: Can define a default choice for "More action when recording a
subscription" (foundation module).
- New: Add link to check professional id for India.
- New: [ task #731 ] Uniformize ref generation
- New: [ task #748 ] Add a link "Dolibarr" into left menu
- New: Script email_unpaid_invoices_to_representative accepts now a parameter test
and a delay.
- New: Can define a different clicktodial setup per user.
- New: Add option INVOICE_CAN_NEVER_BE_REMOVED.
- New: Enhance agenda module to reach RFC2445 (add busy information).
- New: Script email_unpaid_invoices_to_representative accepts now a parameter "test"
and a "late delay".
- New: Can define different clicktodial setups for each user.
- New: Add hidden option INVOICE_CAN_NEVER_BE_REMOVED.
- New: Enhance agenda module to reach RFC2445 ("type" not enabled by default and add
"busy" information).
- New: Add module Opensurvey.
- New: Default aprrover for holidays i sby default hierchical parent.
- New: Default approver for holidays is set by default to hierchical parent.
- First change to prepare feature "click to print" (IPP) for PDF.
- New: [ task #350 ] Merge tab customer and prospect
- New: [ task #710 ] Add substitution into mailing send (and HTML is now valid)
- New: [ task #711 ] Add combobox for contact as done for product/thirdparty
- New: [ task #714 ] In Emailing module admin autogenerate security key of READRECIEPT
- New: [ task #743 ] GED : Add aministration option to disabled autotree to display
- New: [ task #767 ] Customer Address fallback when a contact doesn't have an address
- New: [ task #768 ] WYSIWYG for all mail
- New: [ task #773 ] Add Project document in GED(ECM) modules
- New: [ task #783 ] Add checkbox and radio into extrafield feature
- New: [ task #798 ] Add range limit date on product/services as it is done on order and invoice
- New: [ task #814 ] Add extrafield feature into Project/project tasks module
- New: [ task #770 ] Add ODT document generation for Projects module
- New: [ task #741 ] Add intervention box
- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated
- New: [ task #823 ] Shipping_validate email notification
- New: [ task #350 ] Merge tab customer and prospect.
- New: [ task #710 ] Add substitution into mailing send (and HTML is now valid).
- New: [ task #711 ] Add combobox for contact, as done for product/thirdparty.
- New: [ task #714 ] In Emailing module admin autogenerate security key of READRECEIPT.
- New: [ task #743 ] GED : Add aministration option to disable autotree display.
- New: [ task #767 ] Customer Address fallback when a contact doesn't have an address.
- New: [ task #768 ] WYSIWYG for all mails.
- New: [ task #773 ] Add Project document in GED(ECM) modules.
- New: [ task #783 ] Add more types for extra parameters (lists, phone, emails, checkbox,
prices, radio).
- New: [ task #798 ] Add range limit date on product/services as it is done on order
and invoice.
- New: [ task #814 ] Add extrafield feature for projects ands tasks.
- New: [ task #770 ] Add ODT document generation for Projects module.
- New: [ task #741 ] Add intervention box.
- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated.
- New: [ task #823 ] Shipping_validate email notification.
For translators:
- Update language files.
@ -60,8 +63,8 @@ For developers:
- An external module can force its theme.
- Add function dol_set_focus('#xxx').
- A mymodule can bring its own core/modules/mymodule/modules_mymodule.php file.
- Removed not used libraries.
- More web services.
- Removed some not used libraries.
- More web services.
- Renamed some database fields, code variables and parameters from french to english.
- First change to manage margins on contracts.
- Add hook getFormMail.

View File

@ -51,6 +51,19 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
$act = new ActionComm($db);
if ($objectid > 0)
{
$ret = $act->fetch($objectid);
if ($ret > 0) {
$company=new Societe($db);
$company->fetch($act->societe->id);
$act->societe=$company; // For backward compatibility
$act->thirdparty=$company;
}
}
// Get parameters
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -79,7 +92,7 @@ if ($action == 'delete')
{
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file);
$ret=dol_delete_file($file,0,0,0,$act);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
$action='';
@ -96,184 +109,172 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('',$langs->trans("Agenda"),$help_url);
if ($objectid > 0)
if ($act->id > 0)
{
$act = new ActionComm($db);
if ($act->fetch($objectid))
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
$author=new User($db);
$author->fetch($act->author->id);
$act->author=$author;
if ($act->contact->id) $act->fetch_contact($act->contact->id);
$head=actions_prepare_head($act);
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
// Affichage fiche action en mode visu
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print '</td></tr>';
// Type
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
}
$company=new Societe($db);
$company->fetch($act->societe->id);
$act->societe=$company;
// Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
$author=new User($db);
$author->fetch($act->author->id);
$act->author=$author;
// Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent).'</td></tr>';
if ($act->contact->id) $act->fetch_contact($act->contact->id);
// Date start
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
else print dol_print_date($act->datep,'day');
if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>';
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_week">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_day">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '</td>';
print '</tr>';
$head=actions_prepare_head($act);
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
else print dol_print_date($act->datef,'day');
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print '</td></tr>';
// Affichage fiche action en mode visu
print '<table class="border" width="100%">';
// Status
print '<tr><td nowrap>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
print $act->getLibStatut(4);
print '</td></tr>';
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
// Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$act->location.'</td></tr>';
// Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print '</td></tr>';
// Type
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
print '</table><br><br><table class="border" width="100%">';
// Third party - Contact
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
if ($act->societe->id && $act->type_code == 'AC_TEL')
{
if ($act->societe->fetch($act->societe->id))
{
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
print "<br>".dol_print_phone($act->societe->tel);
}
// Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
// Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent).'</td></tr>';
// Date start
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
else print dol_print_date($act->datep,'day');
if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>';
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_week">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_day">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '</td>';
print '</tr>';
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
else print dol_print_date($act->datef,'day');
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print '</td></tr>';
// Status
print '<tr><td nowrap>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
print $act->getLibStatut(4);
print '</td></tr>';
// Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$act->location.'</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Third party - Contact
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
if ($act->societe->id && $act->type_code == 'AC_TEL')
{
if ($act->societe->fetch($act->societe->id))
{
print "<br>".dol_print_phone($act->societe->tel);
}
}
print '</td>';
print '<td>'.$langs->trans("Contact").'</td>';
print '<td>';
if ($act->contact->id > 0)
{
print $act->contact->getNomUrl(1);
if ($act->contact->id && $act->type_code == 'AC_TEL')
{
if ($act->contact->fetch($act->contact->id))
{
print "<br>".dol_print_phone($act->contact->phone_pro);
}
}
}
else
{
print $langs->trans("None");
}
print '</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project)
{
$project=new Project($db);
$project->fetch($act->fk_project);
print $project->getNomUrl(1);
}
print '</td></tr>';
}
// Priority
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
print ($act->priority?$act->priority:'');
print '</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
}
print '</td>';
print '<td>'.$langs->trans("Contact").'</td>';
print '<td>';
if ($act->contact->id > 0)
{
print $act->contact->getNomUrl(1);
if ($act->contact->id && $act->type_code == 'AC_TEL')
{
$totalsize+=$file['size'];
if ($act->contact->fetch($act->contact->id))
{
print "<br>".dol_print_phone($act->contact->phone_pro);
}
}
print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create));
// List of document
$param='&id='.$act->id;
$formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create);
}
else
{
dol_print_error($db);
print $langs->trans("None");
}
print '</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project)
{
$project=new Project($db);
$project->fetch($act->fk_project);
print $project->getNomUrl(1);
}
print '</td></tr>';
}
// Priority
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
print ($act->priority?$act->priority:'');
print '</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
$totalsize+=$file['size'];
}
print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';
print '</div>';
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act);
// List of document
$param='&id='.$act->id;
$formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create);
}
else
{

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
*/
class ChargeSociales extends CommonObject
{
public $element='rowid';
public $element='chargesociales';
public $table='chargesociales';
public $table_element='chargesociales';

View File

@ -79,7 +79,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
if ($action == 'delete')
{
$file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file);
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
}
@ -172,7 +172,7 @@ if ($object->id)
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object);
// List of document

View File

@ -56,6 +56,8 @@ class FileUpload
$filename = $regs[2];
}
$parentForeignKey = '';
// For compatibility
if ($element == 'propal') {
$pathname = 'comm/propal';
@ -69,6 +71,14 @@ class FileUpload
$element = $pathname = 'projet';
$dir_output=$conf->$element->dir_output;
}
elseif ($element == 'project_task') {
$pathname = 'projet'; $filename='task';
$dir_output=$conf->projet->dir_output;
$parentForeignKey = 'fk_project';
$parentClass = 'Project';
$parentElement = 'projet';
$parentObject = 'project';
}
elseif ($element == 'fichinter') {
$element='ficheinter';
$dir_output=$conf->$element->dir_output;
@ -80,6 +90,17 @@ class FileUpload
elseif ($element == 'invoice_supplier') {
$pathname = 'fourn'; $filename='fournisseur.facture';
$dir_output=$conf->fournisseur->facture->dir_output;
}
elseif ($element == 'product') {
$dir_output = $conf->product->multidir_output[$conf->entity];
}
elseif ($element == 'action') {
$pathname = 'comm/action'; $filename='actioncomm';
$dir_output=$conf->agenda->dir_output;
}
elseif ($element == 'chargesociales') {
$pathname = 'compta/sociales'; $filename='chargesociales';
$dir_output=$conf->tax->dir_output;
} else {
$dir_output=$conf->$element->dir_output;
}
@ -97,11 +118,23 @@ class FileUpload
$object = new $classname($db);
$object->fetch($fk_element);
$object->fetch_thirdparty();
if (!empty($parentForeignKey)) {
dol_include_once('/'.$parentElement.'/class/'.$parentObject.'.class.php');
$parent = new $parentClass($db);
$parent->fetch($object->$parentForeignKey);
if (!empty($parent->socid)) {
$parent->fetch_thirdparty();
}
$object->$parentObject = dol_clone($parent);
} else {
$object->fetch_thirdparty();
}
$object_ref = dol_sanitizeFileName($object->ref);
if ($element == 'invoice_supplier') {
$object_ref = get_exdir($object->id, 2) . $object_ref;
} else if ($element == 'project_task') {
$object_ref = $object->project->ref . '/' . $object_ref;
}
$this->options = array(

View File

@ -344,7 +344,7 @@ class Form
* Show a text and picto with tooltip on text or picto
*
* @param string $text Text to show
* @param string $htmltext Content html of tooltip. Must be HTML/UTF8 encoded.
* @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded.
* @param int $tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2
* @param int $direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres
* @param string $img Code img du picto (use img_xxx() function to get it)
@ -383,7 +383,7 @@ class Form
//if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>';
$paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':'');
$paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':'');
if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>';
if (empty($notabs)) $s.='</tr></table>';

View File

@ -47,7 +47,7 @@ function societe_prepare_head($object)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id;
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client==2 || $object->client==3)) $head[$h][1] = $langs->trans("Prospect");
if ($object->client==3) $head[$h][1] .= '/';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client==3) $head[$h][1] .= '/';
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client==1 || $object->client==3)) $head[$h][1] .= $langs->trans("Customer");
$head[$h][2] = 'customer';
$h++;

View File

@ -658,7 +658,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$langs->load("orders");
$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
$newmenu->add("/societe/societe.php?leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
$newmenu->add("/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
$newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);

View File

@ -198,10 +198,10 @@ class modFacture extends DolibarrModules
$this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
$this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -179,7 +179,7 @@ if ($forgetpasslink || $helpcenterlink)
<?php if ($main_home)
{
?>
<center><div align="center" style="max-width: 80%">
<center><div align="center" class="login_main_home" style="max-width: 80%">
<?php echo $main_home; ?>
</div></center><br>
<?php

View File

@ -111,10 +111,12 @@ ServiceLimitedDuration=If product is a service with limited duration:
MultiPricesAbility=Activate the multi-prices
MultiPricesNumPrices=Number of price
MultiPriceLevelsName=Price categories
AssociatedProductsAbility=Activate the sub-products
AssociatedProducts=Sub-products
AssociatedProductsNumber=Number of products composing this product
ParentProductsNumber=Number of parent product
AssociatedProductsAbility=Activate the virtual products feature
AssociatedProducts=Virtual product
AssociatedProductsNumber=Number of products composing this virtual product
ParentProductsNumber=Number of parent virtual product
IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual product
IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual product
EditAssociate=Associate
Translation=Translation
KeywordFilter=Keyword filter
@ -124,7 +126,7 @@ AddDel=Add/Delete
Quantity=Quantity
NoMatchFound=No match found
ProductAssociationList=List of related products/services: name of product/service (quantity affected)
ProductParentList=List of products/services with this product as a component
ProductParentList=List of virtual products/services with this product as a component
ErrorAssociationIsFatherOfThis=One of selected product is parent with current product
DeleteProduct=Delete a product/service
ConfirmDeleteProduct=Are you sure you want to delete this product/service?

View File

@ -111,11 +111,13 @@ ServiceLimitedDuration=Si produit de type service à durée limitée :
MultiPricesAbility=Prise en charge de prix multiples
MultiPricesNumPrices=Nombre de prix
MultiPriceLevelsName=Catégorie de prix
AssociatedProductsAbility=Prise en charge des produits composés
AssociatedProducts=Composition
AssociatedProductsNumber=Nbre de sous-produits composant ce produit
ParentProductsNumber=Nbre de produits parent
EditAssociate=Composer
AssociatedProductsAbility=Prise en charge des produits virtuels
AssociatedProducts=Produit virtuel
AssociatedProductsNumber=Nbre de sous-produits constituant ce produit virtuel
ParentProductsNumber=Nbre de produits virtuels parent
IfZeroItIsNotAVirtualProduct=Si 0, ce produit n'est pas un produit virtuel
IfZeroItIsNotUsedByVirtualProduct=Si 0, ce produit n'est pas utilisé par un produit virtuel
EditAssociate=Composer comme produit virtuel
Translation=Traduction
KeywordFilter=Filtre par mot-clé
CategoryFilter=Filtre par catégorie
@ -123,8 +125,8 @@ ProductToAddSearch=Recherche des produits à ajouter
AddDel=Ajouter/Retirer
Quantity=Quantité
NoMatchFound=Aucun résultat n'a été trouvé
ProductAssociationList=Liste des produits/services composant ce produit: Le nombre entre parenthèse est la quantité affectée dans cette composition.
ProductParentList=Liste des produits/services avec ce produit comme composante
ProductAssociationList=Liste des produits/services composant ce produit virtuel: Le nombre entre parenthèse est la quantité affectée dans cette composition.
ProductParentList=Liste des produits/services virtuels avec ce produit comme composante
ErrorAssociationIsFatherOfThis=L'un des produits sélectionnés est parent du produit en cours
DeleteProduct=Supprimer un produit/service
ConfirmDeleteProduct=Êtes-vous sûr de vouloir supprimer ce produit/service ?

View File

@ -1803,7 +1803,7 @@ class Product extends CommonObject
$result=$this->del_sousproduit($id_pere, $id_fils);
if ($result < 0) return $result;
// Check not already father of id_pere (to avoid father -> child -> father links)
$sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association';
$sql .= ' WHERE fk_product_pere = '.$id_fils.' AND fk_product_fils = '.$id_pere;
@ -1852,11 +1852,11 @@ class Product extends CommonObject
{
if (! is_numeric($fk_parent)) $fk_parent=0;
if (! is_numeric($fk_child)) $fk_child=0;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association";
$sql.= " WHERE fk_product_pere = ".$fk_parent;
$sql.= " AND fk_product_fils = ".$fk_child;
dol_syslog(get_class($this).'::del_sousproduit sql='.$sql);
if (! $this->db->query($sql))
{
@ -2122,7 +2122,7 @@ class Product extends CommonObject
* Define value of this->res
*
* @param array $prod Products array
* @param string $compl_path Directory path
* @param string $compl_path Directory path of parents to add before
* @param int $multiply Because each sublevel must be multiplicated by parent nb
* @param int $level Init level
* @return void
@ -2132,65 +2132,36 @@ class Product extends CommonObject
global $conf,$langs;
$product = new Product($this->db);
foreach($prod as $nom_pere => $desc_pere)
//var_dump($prod);
foreach($prod as $id_product => $desc_pere) // nom_pere is 0 or id of sub_product
{
if (is_array($desc_pere)) // If this parent desc is an array, this is an array of childs
{
$id=(! empty($desc_pere[0]) ? $desc_pere[0] :'');
$nb=(! empty($desc_pere[1]) ? $desc_pere[1] :'');
$type=(! empty($desc_pere[2]) ? $desc_pere[2] :'');
$label=(! empty($desc_pere[3]) ? $desc_pere[3] :'');
if ($multiply < 1) $multiply=1;
if ($multiply)
{
//print "XXX ".$desc_pere[1]." multiply=".$multiply;
$img="";
$this->fetch($id);
$this->load_stock();
if ($this->stock_warehouse[1]->real < $this->seuil_stock_alerte)
{
$img=img_warning($langs->trans("StockTooLow"));
}
$this->res[]= array(
/* "<tr><td>&nbsp; &nbsp; &nbsp; ->
<a href=\"".DOL_URL_ROOT."/product/fiche.php?id=".$desc_pere[0]."\">".$compl_path.stripslashes($nom_pere)."
</a> (".$desc_pere[1].")</td><td align=\"center\"> ".($desc_pere[1]*$multiply)."</td><td>&nbsp</td><td>&nbsp</td>
<td align=\"center\">".$this->stock_entrepot[1]." ".$img."</td></tr>",
$desc_pere[0], // Id product
*/ 'id'=>$id, // Id product
'nb'=>$nb, // Nb of units that compose parent product
'nb_total'=>$nb*$multiply, // Nb of units for all nb of product
'stock'=>$this->stock_warehouse[1]->real, // Stock
'stock_alert'=>$this->seuil_stock_alerte, // Stock alert
'fullpath' => $compl_path.$nom_pere, // Label
'type'=>$type // Nb of units that compose parent product
);
}
else
{
$this->fetch($desc_pere[0]);
$this->load_stock();
$this->res[]= array(
/* $compl_path.$nom_pere." (".$desc_pere[1].")",
$desc_pere[0], // Id product
*/ 'id'=>$id, // Id product
//print "XXX We add id=".$id." - label=".$label." - nb=".$nb." - multiply=".$multiply." fullpath=".$compl_path.$label."\n";
$this->fetch($id);
$this->load_stock();
$this->res[]= array(
'id'=>$id, // Id product
'nb'=>$nb, // Nb of units that compose parent product
'nb_total'=>$nb, // Nb of units for all nb of product
'stock'=>$this->stock_warehouse[1]->real, // Stock
'nb_total'=>$nb*$multiply, // Nb of units for all nb of product
'stock'=>$this->stock_warehouse[1]->real, // Stock
'stock_alert'=>$this->seuil_stock_alerte, // Stock alert
'fullpath' => $compl_path.$nom_pere, // Label
'type'=>$type // Nb of units that compose parent product
);
}
}
else if($nom_pere != "0" && $nom_pere != "1")
{
$this->res[]= array($compl_path.$nom_pere,$desc_pere);
'fullpath' => $compl_path.$label, // Label
'type'=>$type // Nb of units that compose parent product
);
}
// Recursive call if child is an array
if (is_array($desc_pere[0]))
if (is_array($desc_pere['childs']))
{
$this ->fetch_prod_arbo($desc_pere[0], $nom_pere." -> ", $desc_pere[1]*$multiply, $level+1);
//print 'YYY We go down for '.$desc_pere[3]." -> \n";
$this ->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1]*$multiply, $level+1);
}
}
}
@ -2227,11 +2198,12 @@ class Product extends CommonObject
$this->res = array();
if (isset($this->sousprods) && is_array($this->sousprods))
{
foreach($this->sousprods as $nom_pere => $desc_pere)
foreach($this->sousprods as $prod_name => $desc_product)
{
if (is_array($desc_pere)) $this->fetch_prod_arbo($desc_pere,"",$multiply);
if (is_array($desc_product)) $this->fetch_prod_arbo($desc_product,"",$multiply);
}
}
//var_dump($this->res);
return $this->res;
}
@ -2292,7 +2264,7 @@ class Product extends CommonObject
/**
* Return all parent products fo current product
* Return all direct parent products fo current product
*
* @return array prod
*/
@ -2323,19 +2295,19 @@ class Product extends CommonObject
}
/**
* Return childs of product with if fk_parent
* Return childs of product $id
*
* @param int $fk_parent Id of product to search childs of
* @param int $id Id of product to search childs of
* @return array Prod
*/
function getChildsArbo($fk_parent)
function getChildsArbo($id)
{
$sql = "SELECT p.rowid, p.label as label, pa.qty as qty, pa.fk_product_fils as id, p.fk_product_type";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= ", ".MAIN_DB_PREFIX."product_association as pa";
$sql.= " WHERE p.rowid = pa.fk_product_fils";
$sql.= " AND pa.fk_product_pere = ".$fk_parent;
$sql.= " AND pa.fk_product_fils != ".$fk_parent; // This should not happens, it is to avoid invinite loop if it happens
$sql.= " AND pa.fk_product_pere = ".$id;
$sql.= " AND pa.fk_product_fils != ".$id; // This should not happens, it is to avoid infinite loop if it happens
dol_syslog(get_class($this).'::getChildsArbo sql='.$sql);
$res = $this->db->query($sql);
@ -2350,7 +2322,7 @@ class Product extends CommonObject
$listofchilds=$this->getChildsArbo($rec['id']);
foreach($listofchilds as $keyChild => $valueChild)
{
$prods[$rec['rowid']][$keyChild] = $valueChild;
$prods[$rec['rowid']]['childs'][$keyChild] = $valueChild;
}
}
@ -2372,14 +2344,14 @@ class Product extends CommonObject
function get_sousproduits_arbo()
{
$parent = $this->getParent();
foreach($parent as $key => $value)
foreach($parent as $key => $value) // key=label, value[0]=id
{
foreach($this->getChildsArbo($value[0]) as $keyChild => $valueChild)
{
$parent[$key][$keyChild] = $valueChild;
}
}
foreach($parent as $key => $value)
foreach($parent as $key => $value) // key=label, value is array of childs
{
$this->sousprods[$key] = $value;
}
@ -2417,7 +2389,7 @@ class Product extends CommonObject
else if ($option == 'category')
{
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=0">';
}
}
else
{
$lien = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$this->id.'">';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -198,15 +198,18 @@ if ($id || $ref)
print '</tr>';
// Number of subproducts
$prodsfather = $product->getFather(); //Parent Products
$prodsfather = $product->getFather(); // Parent Products
$product->get_sousproduits_arbo();
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.count($product->get_arbo_each_prod()).'</td>';
$prods_arbo=$product->get_arbo_each_prod();
$nbofsubproducts=count($prods_arbo);
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>';
print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct'));
print '</td>';
dol_fiche_end();
// List of subproducts
$prods_arbo = $product->get_arbo_each_prod();
// List of products into this virtual product
if (count($prods_arbo) > 0)
{
print '<tr><td colspan="2">';
@ -223,6 +226,7 @@ if ($id || $ref)
//print $productstatic->getNomUrl(1).'<br>';
//print $value[0]; // This contains a tr line.
print '<tr>';
//print '<td>'.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].($value['nb_total'] > $value['nb']?'->'.$value['nb_total']:'').') &nbsp &nbsp</td>';
print '<td>'.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].') &nbsp &nbsp</td>';
if (! empty($conf->stock->enabled)) print '<td>'.$langs->trans("Stock").' : <b>'.$productstatic->stock_reel.'</b></td>';
print '</tr>';
@ -231,8 +235,10 @@ if ($id || $ref)
print '</td></tr>';
}
// Number of parent products
print '<tr><td>'.$langs->trans("ParentProductsNumber").'</td><td>'.count($prodsfather).'</td>';
// Number of parent virtual products
print '<tr><td>'.$langs->trans("ParentProductsNumber").'</td><td>';
print $form->textwithpicto(count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct'));
print '</td>';
if (count($prodsfather) > 0)
{
@ -286,12 +292,14 @@ if ($id || $ref)
// Number of subproducts
$prodsfather = $product->getFather(); //Parent Products
$product->get_sousproduits_arbo();
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.count($product->get_arbo_each_prod()).'</td>';
$prods_arbo=$product->get_arbo_each_prod();
$nbofsubproducts=count($prods_arbo);
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>';
print $form->textwithpicto($nbofsubproducts, $langs->trans('IfZeroItIsNotAVirtualProduct'));
print '</td>';
print '</tr>';
// List of subproducts
$prods_arbo = $product->get_arbo_each_prod();
//var_dump($prods_arbo);
if(count($prods_arbo) > 0)
{
print '<tr><td colspan="2">';
@ -316,8 +324,10 @@ if ($id || $ref)
print '</td></tr>';
}
// Number of parent products
print '<tr><td>'.$langs->trans("ParentProductsNumber").'</td><td>'.count($prodsfather).'</td>';
// Number of parent virtual products
print '<tr><td>'.$langs->trans("ParentProductsNumber").'</td><td>';
print $form->textwithpicto(count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct'));
print '</td>';
if (count($prodsfather) > 0)
{

View File

@ -183,6 +183,7 @@ class Task extends CommonObject
$sql.= " t.label,";
$sql.= " t.description,";
$sql.= " t.duration_effective,";
$sql.= " t.datec,";
$sql.= " t.dateo,";
$sql.= " t.datee,";
$sql.= " t.fk_user_creat,";

View File

@ -93,7 +93,11 @@ if ($id > 0 || ! empty($ref))
{
$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
if (! empty($projectstatic->socid)) {
$projectstatic->fetch_thirdparty();
}
$object->project = dol_clone($projectstatic);
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
}
@ -114,7 +118,7 @@ if ($action=='delete')
{
$langs->load("other");
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file);
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);

View File

@ -349,6 +349,8 @@ div.tmenu ul li a.tmenusel {/* texte du menu principal sélectionné */
/* Login */
body.body center { color:white; margin-top: 100px; }
form#login {
display:block;
border:solid 1px rgba(0,0,0,.4);
@ -493,6 +495,10 @@ img.login, img.printer, img.entity {
font-weight:bold;
}
div.login_main_home {
color: #000000;
}
/* ============================================================================== */
/* Menu gauche */
@ -913,7 +919,7 @@ div.fichehalfright {
<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?>
}
div.ficheaddleft {
<?php if (empty($conf->dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; }
<?php if (empty($conf->dol_optimize_smallscreen)) { print "padding-left: 16px;\n"; }
else print "margin-top: 10px;\n"; ?>
}

View File

@ -1326,7 +1326,7 @@ a.tabTitle {
text-shadow:1px 1px 1px #ffffff;
font-family: <?php print $fontlist ?>;
font-weight: normal;
padding: 5px 6px 2px 6px;
padding: 4px 6px 2px 6px;
margin: 0px 6px;
text-decoration: none;
white-space: nowrap;
@ -1334,7 +1334,7 @@ a.tabTitle {
a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
font-family: <?php print $fontlist ?>;
padding: 5px 6px 2px 6px;
padding: 4px 6px 2px 6px;
margin: 0em 0.2em;
text-decoration: none;
white-space: nowrap;