From bbc263f4b3fc66f5686f9edb2de4a21838bd428e Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 29 Mar 2021 18:39:22 +0200 Subject: [PATCH 01/29] llx_product batch_mask definition --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 3 +-- htdocs/install/mysql/tables/llx_product.sql | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 772f0e51bdf..bffdcf213ee 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -282,5 +282,4 @@ DELETE FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ti ALTER TABLE llx_c_ticket_category ADD COLUMN public integer DEFAULT 0; - - +ALTER TABLE llx_product ADD COLUMN batch_mask VARCHAR(32); diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 2431c884c62..0cae99c3507 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -51,7 +51,7 @@ create table llx_product recuperableonly integer NOT NULL DEFAULT '0', -- French NPR VAT localtax1_tx double(6,3) DEFAULT 0, localtax1_type varchar(10) NOT NULL DEFAULT '0', - localtax2_tx double(6,3) DEFAULT 0, + localtax2_tx double(6,3) DEFAULT 0, localtax2_type varchar(10) NOT NULL DEFAULT '0', fk_user_author integer DEFAULT NULL, -- user making creation fk_user_modif integer, -- user making last change @@ -59,6 +59,7 @@ create table llx_product tobuy tinyint DEFAULT 1, -- Product you buy onportal tinyint DEFAULT 0, -- If it is a product you sell and you want to sell it on portal (module website must be on) tobatch tinyint DEFAULT 0 NOT NULL, -- Is it a product that need a batch management (eat-by or lot management) + batch mask varchar(32), -- If the product has batch feature, you may want to use a batch mask per product fk_product_type integer DEFAULT 0, -- Type of product: 0 for regular product, 1 for service, 9 for other (used by external module) duration varchar(6), seuil_stock_alerte float DEFAULT NULL, From 0adbffd8645457abc155169f9461f8a0b0cd36d1 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 2 Apr 2021 08:24:10 +0200 Subject: [PATCH 02/29] fix typo --- htdocs/install/mysql/tables/llx_product.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 0cae99c3507..da8c2ff693c 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -59,7 +59,7 @@ create table llx_product tobuy tinyint DEFAULT 1, -- Product you buy onportal tinyint DEFAULT 0, -- If it is a product you sell and you want to sell it on portal (module website must be on) tobatch tinyint DEFAULT 0 NOT NULL, -- Is it a product that need a batch management (eat-by or lot management) - batch mask varchar(32), -- If the product has batch feature, you may want to use a batch mask per product + batch_mask varchar(32), -- If the product has batch feature, you may want to use a batch mask per product fk_product_type integer DEFAULT 0, -- Type of product: 0 for regular product, 1 for service, 9 for other (used by external module) duration varchar(6), seuil_stock_alerte float DEFAULT NULL, From 88b481e5a8ea3bd95b76e0a1f6ebc5142d0eb865 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 2 Apr 2021 11:25:14 +0200 Subject: [PATCH 03/29] keep tab project --- .../class/conferenceorboothattendee.class.php | 6 +++++- .../conferenceorboothattendee_card.php | 9 +++++++-- .../conferenceorboothattendee_list.php | 4 ++-- htdocs/projet/class/project.class.php | 11 +++++++++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 3b0795ef2a0..ef5e85c7229 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -104,7 +104,7 @@ class ConferenceOrBoothAttendee extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",), 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>1, 'visible'=>0, 'index'=>1,), - 'email' => array('type'=>'mail', 'label'=>'Email', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>1, 'index'=>1,), + 'email' => array('type'=>'mail', 'label'=>'Email', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,), 'date_subscription' => array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), 'amount' => array('type'=>'price', 'label'=>'AmountOfSubscriptionPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), @@ -745,6 +745,10 @@ class ConferenceOrBoothAttendee extends CommonObject if ($option == 'conforboothid') { $url .= '&conforboothid='.$this->fk_actioncomm; } + + if ($option == 'conforboothidproject') { + $url .= '&conforboothid='.$this->fk_actioncomm.'&withproject=1' ; + } } $linkclose = ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 57cf6baba78..68f6c4eef13 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -110,7 +110,12 @@ if ($reshook < 0) { if (empty($reshook)) { $error = 0; - $backurlforlist = dol_buildpath('/eventorganization/conferenceorboothattendee_list.php', 1); + if (!empty($withproject)) { + $backurlforlist = dol_buildpath('/eventorganization/conferenceorboothattendee_list.php?withproject=1', 1); + } else { + $backurlforlist = dol_buildpath('/eventorganization/conferenceorboothattendee_list.php', 1); + } + if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { @@ -492,7 +497,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index d62830de925..0505f6c7461 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -604,7 +604,7 @@ print ''; print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($confOrBooth->id)?'?conforboothid='.$confOrBooth->id:'').$withProjectUrl, '', $permissiontoadd); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].(!empty($confOrBooth->id)?'?conforboothid='.$confOrBooth->id:'').$withProjectUrl), '', $permissiontoadd); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); @@ -776,7 +776,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if ($key == 'status') { print $object->getLibStatut(5); } elseif ($key == 'ref') { - print $object->getNomUrl(1, 'conforboothid'); + print $object->getNomUrl(1, (!empty($withproject)?'conforboothidproject':'conforboothid')); } else { print $object->showOutputField($val, $key, $object->$key, ''); } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 7fc9646c489..11af1f4ea13 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -115,6 +115,17 @@ class Project extends CommonObject */ public $usage_bill_time; // Is the time spent on project must be invoiced or not + /** + * @var boolean Use opportunities management + */ + public $usage_opportunity; + + /** + * @var boolean Use task management + */ + public $usage_task; + + /** * @var boolean Event organization: Use Event Organization */ From 4cf8c4c685c590077d5b93eab16ad85f16168f16 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 2 Apr 2021 12:06:03 +0200 Subject: [PATCH 04/29] add conf or booth contact tab and roles --- .../conferenceorbooth_card.php | 2 +- .../conferenceorbooth_contact.php | 63 ++++++++++++++++--- ...ventorganization_conferenceorbooth.lib.php | 8 +-- .../install/mysql/data/llx_c_type_contact.sql | 5 +- .../install/mysql/migration/13.0.0-14.0.0.sql | 5 ++ 5 files changed, 69 insertions(+), 14 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index bcdb2001194..29d6758e259 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -45,7 +45,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'co $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $withproject = GETPOST('withproject', 'int'); -$project_ref = GETPOST('project_ref', 'alpha'); +$mode = GETPOST('mode', 'alpha'); // Initialize technical objects $object = new ConferenceOrBooth($db); diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 4efd404d78d..4906a4e05e3 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -55,9 +55,10 @@ if (!$res) { require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -dol_include_once('/eventorganization/class/conferenceorbooth.class.php'); -dol_include_once('/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'); - +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; // Load translation files required by the page $langs->loadLangs(array("eventorganization@eventorganization", "companies", "other", "mails")); @@ -66,10 +67,12 @@ $ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); +$withproject = GETPOST('withproject', 'int'); // Initialize technical objects $object = new ConferenceOrBooth($db); $extrafields = new ExtraFields($db); +$projectstatic = new Project($db); $diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('conferenceorboothcontact', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels @@ -85,7 +88,7 @@ if ($user->socid > 0) { $isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); -$permission = $user->rights->eventorganization->conferenceorbooth->write; +$permission = $user->rights->eventorganization->write; /* @@ -98,7 +101,7 @@ if ($action == 'addcontact' && $permission) { // Add a new contact $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); if ($result >= 0) { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.(!empty($withproject)?'&withproject=1':'')); exit; } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { @@ -116,7 +119,7 @@ if ($action == 'addcontact' && $permission) { // Add a new contact $result = $object->delete_contact($lineid); if ($result >= 0) { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.(!empty($withproject)?'&withproject=1':'')); exit; } else { dol_print_error($db); @@ -144,9 +147,21 @@ $userstatic = new User($db); /* View and edit mode */ /* */ /* *************************************************************************** */ + +$result = $projectstatic->fetch($object->fk_project); +if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) { + $projectstatic->fetchComments(); +} +if (!empty($projectstatic->socid)) { + $projectstatic->fetch_thirdparty(); +} +$withProjectUrl=''; +$object->project = clone $projectstatic; + if (!empty($withproject)) { // Tabs for project $tab = 'eventorganisation'; + $withProjectUrl="&withproject=1"; $head = project_prepare_head($projectstatic); print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); @@ -204,7 +219,7 @@ if (!empty($withproject)) { print '
'; } if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); } @@ -265,6 +280,38 @@ if (!empty($withproject)) { print ""; } + print ''; + $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : ''); + $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp"); + print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext); + print ''; + print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid'); + print ""; + + print ''; + $typeofdata = 'checkbox:'.($projectstatic->accept_booth_suggestions ? ' checked="checked"' : ''); + $htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp"); + print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext); + print ''; + print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid'); + print ""; + + print ''; + print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); + print ''; + print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print ""; + + print ''; + print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid'); + print ''; + print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid'); + print ""; + + print ''.$langs->trans("EventOrganizationICSLink").''; + print ''; + print ""; + print ''; print '
'; @@ -282,7 +329,7 @@ if ($object->id) { /* * Show tabs */ - $head = conferenceorboothPrepareHead($object); + $head = conferenceorboothPrepareHead($object, $withproject); print dol_get_fiche_head($head, 'contact', $langs->trans("ConferenceOrBooth"), -1, $object->picto); diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index f822bdea743..7d6339a2ed0 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -47,10 +47,10 @@ function conferenceorboothPrepareHead($object, $with_project = 0) $head[$h][2] = 'card'; $h++; - //$head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_contact.php", 1).'?conforboothid='.$object->id.$withProjectUrl; - //$head[$h][1] = $langs->trans("Contact/Adress"); - //$head[$h][2] = 'attendees'; - //$h++; + $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_contact.php", 1).'?id='.$object->id.$withProjectUrl; + $head[$h][1] = $langs->trans("ContactsAddresses"); + $head[$h][2] = 'contact'; + $h++; $head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_list.php", 1).'?conforboothid='.$object->id.$withProjectUrl; $head[$h][1] = $langs->trans("Attendees"); diff --git a/htdocs/install/mysql/data/llx_c_type_contact.sql b/htdocs/install/mysql/data/llx_c_type_contact.sql index f16cf5ca5df..78fdade6e9a 100644 --- a/htdocs/install/mysql/data/llx_c_type_contact.sql +++ b/htdocs/install/mysql/data/llx_c_type_contact.sql @@ -93,9 +93,12 @@ INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, m INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL); -- Supplier proposal - insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); +-- Event Organization +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (210, 'conferenceorbooth', 'internal', 'MANAGER', 'Conference or Booth manager', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (211, 'conferenceorbooth', 'external', 'SPEAKER', 'Conference Speaker', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (212, 'conferenceorbooth', 'external', 'RESPONSIBLE', 'Booth responsible', 1); diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index af32340170e..ab7ed5b8423 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -359,3 +359,8 @@ ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_signature FOREIGN KEY (f UPDATE llx_propal SET fk_user_signature = fk_user_cloture WHERE fk_user_signature IS NULL AND fk_user_cloture IS NOT NULL; UPDATE llx_propal SET date_signature = date_cloture WHERE date_signature IS NULL AND date_cloture IS NOT NULL; + + +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (210, 'conferenceorbooth', 'internal', 'MANAGER', 'Conference or Booth manager', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (211, 'conferenceorbooth', 'external', 'SPEAKER', 'Conference Speaker', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (212, 'conferenceorbooth', 'external', 'RESPONSIBLE', 'Booth responsible', 1); From c23610f851b5840452d4c4003cb7306ade428322 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Apr 2021 13:31:03 +0200 Subject: [PATCH 05/29] Rename const --- htdocs/core/customreports.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index c5e0137b98d..e178bd393f9 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -15,7 +15,7 @@ * along with this program. If not, see . * * Note: This tool can be included into a list page with : - * define('USE_CUSTOME_REPORT_AS_INCLUDE', 1); + * define('USE_CUSTOM_REPORT_AS_INCLUDE', 1); * include DOL_DOCUMENT_ROOT.'/core/customreports.php'; */ @@ -25,7 +25,7 @@ * \brief Page to make custom reports */ -if (!defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { +if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { require '../main.inc.php'; // Get parameters @@ -194,7 +194,7 @@ $arrayofvaluesforgroupby = array(); $form = new Form($db); $formother = new FormOther($db); -if (!defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { +if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { llxHeader('', $langs->transnoentitiesnoconv('CustomReports'), ''); print dol_get_fiche_head($head, 'customreports', $title, -1, $picto); @@ -790,7 +790,7 @@ if ($sql) { print '
'; -if (!defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { +if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { print dol_get_fiche_end(); } From b23712667914853b0b82ac22a8109d8c7a6e8b6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Apr 2021 13:33:41 +0200 Subject: [PATCH 06/29] Clean code --- htdocs/core/customreports.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index e178bd393f9..ca6e61e3b1c 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -151,8 +151,6 @@ if ($user->socid > 0) { // Protection if external user accessforbidden(); } -$result = restrictedArea($user, $object->element, 0, ''); - // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); //$extrafields->fetch_name_optionals_label($object->table_element_line); @@ -177,6 +175,7 @@ $arrayofgroupby = array(); $arrayofyaxis = array(); $arrayofvaluesforgroupby = array(); +$result = restrictedArea($user, $object->element, 0, ''); /* From 0a03ee5cd4cb3b391f2a9910fadb71d233973857 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Apr 2021 15:44:06 +0200 Subject: [PATCH 07/29] Comment --- .../install/mysql/tables/llx_c_ticket_category.sql | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_c_ticket_category.sql b/htdocs/install/mysql/tables/llx_c_ticket_category.sql index 317be25e142..10d16331a06 100644 --- a/htdocs/install/mysql/tables/llx_c_ticket_category.sql +++ b/htdocs/install/mysql/tables/llx_c_ticket_category.sql @@ -1,4 +1,5 @@ -- Copyright (C) 2013-2018 Jean-François FERRY +-- Copyright (C) 2020-2021 Laurent Destailleur -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -12,20 +13,22 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . + -- --- +-- Table with the categories of a ticket +-- create table llx_c_ticket_category ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1, - code varchar(32) NOT NULL, + code varchar(32) NOT NULL, -- Example: TIGRP-COMMERCIAL, TIGRP-TECHNICALISSUE, ... label varchar(128) NOT NULL, - pos integer DEFAULT 0 NOT NULL, public integer DEFAULT 0, use_default integer DEFAULT 1, - active integer DEFAULT 1, fk_parent integer DEFAULT 0 NOT NULL, -- Parent group force_severity varchar(32) NULL, -- To force the severity if we choosed this category - description varchar(255) + description varchar(255), -- A long description of ticket + pos integer DEFAULT 0 NOT NULL, + active integer DEFAULT 1 )ENGINE=innodb; From 9677d35aca5e88aba9f275dac25ccd4730a5c617 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:18:14 +0200 Subject: [PATCH 08/29] Update llx_10_c_regions.sql --- .../install/mysql/data/llx_10_c_regions.sql | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index b054ca383ef..09981e7d339 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -47,6 +47,17 @@ -- 7 United Kingdom (NOT England) -- +-- CONTENT ------------------------------------------------------------------- +-- +-- Algeria +-- Argentina +-- Australia +-- Austria +-- Barbados +-- Belgium +-- Bolivia +-- Brazil + -- TEMPLATE ---------------------------------------------------------------------------------------- insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 0, 0, '0',0,'-'); @@ -73,7 +84,7 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4 -- Barbados Regions (id country=46) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 46, 4601, '', 0, 'Barbados'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 46, 4601, '', 0, 'Barbados'); -- Belgium Regions (id country=2) @@ -82,6 +93,18 @@ insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2 insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2, 203, '',3,'Bruxelles-Capitale'); +-- Bolivia Regions (id country=52) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5201, '', 0, 'Chuquisaca'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5202, '', 0, 'La Paz'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5203, '', 0, 'Cochabamba'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5204, '', 0, 'Oruro'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5205, '', 0, 'Potosí'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5206, '', 0, 'Tarija'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5207, '', 0, 'Santa Cruz'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5208, '', 0, 'El Beni'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 52, 5209, '', 0, 'Pando'); + + -- Brazil Regions (id country=56) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 56, 5601, '', 0, 'Brasil'); @@ -90,6 +113,10 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 5 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 14, 1401, '', 0, 'Canada'); +-- Colombie Regions (id country=70) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 70, 7001, '', 0, 'Colombie'); + + -- Regions France (id country=1) insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 1,'97105',3,'Guadeloupe'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 2,'97209',3,'Martinique'); @@ -217,21 +244,6 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) va INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 17, 1701, '', 0,'Provincies van Nederland ', 1); --- Regions Bolivia (id country=52) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5201, '', 0, 'Chuquisaca', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5202, '', 0, 'La Paz', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5203, '', 0, 'Cochabamba', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5204, '', 0, 'Oruro', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5205, '', 0, 'Potosí', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5206, '', 0, 'Tarija', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5207, '', 0, 'Santa Cruz', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5208, '', 0, 'El Beni', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5209, '', 0, 'Pando', 1); - - --- Regions Colombie (id country=70) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 70, 7001, '', 0, 'Colombie', 1); - -- Regions Chile (id country=67) INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6701, 67, NULL, NULL, 'Tarapacá', 1); INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6702, 67, NULL, NULL, 'Antofagasta', 1); From 473134cc46b3fe1cc02cdc36651e946b4da04e9e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:26:11 +0200 Subject: [PATCH 09/29] Update llx_20_c_departements.sql Angola - up & fix fk_region 'xx' --- .../mysql/data/llx_20_c_departements.sql | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 1b5da7602e2..d41f2a7454a 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -32,11 +32,12 @@ -- Do not concatenate the values in a single query, for the same reason. --- NOTES ----------------------------------------------------------------------- +-- NOTES/CONTENT --------------------------------------------------------------- -- Departements/Cantons/Provinces/States -- -- Algeria -- Andorra +-- Angola -- Argentina -- Australia -- Austria @@ -113,6 +114,27 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-008', 'AD700', NULL, NULL, 'Escaldes-Engordany'); +-- Angola Provinces (postal districts) (id country=35) +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-ABO', NULL, NULL, 'BENGO', 'Bengo'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-BGU', NULL, NULL, 'BENGUELA', 'Benguela'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-BIE', NULL, NULL, 'BIÉ', 'Bié'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-CAB', NULL, NULL, 'CABINDA', 'Cabinda'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-CCU', NULL, NULL, 'KUANDO KUBANGO', 'Kuando Kubango'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-CNO', NULL, NULL, 'KWANZA NORTE', 'Kwanza Norte'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-CUS', NULL, NULL, 'KWANZA SUL', 'Kwanza Sul'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-CNN', NULL, NULL, 'CUNENE', 'Cunene'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-HUA', NULL, NULL, 'HUAMBO', 'Huambo'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-HUI', NULL, NULL, 'HUÍLA', 'Huila'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-LUA', NULL, NULL, 'LUANDA', 'Luanda'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-LNO', NULL, NULL, 'LUNDA-NORTE', 'Lunda-Norte'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-LSU',NULL, NULL, 'LUNDA-SUL', 'Lunda-Sul'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-MAL', NULL, NULL, 'MALANGE', 'Malange'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-MOX', NULL, NULL, 'MOXICO', 'Moxico'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-NAM', NULL, NULL, 'NAMÍBE', 'Namíbe'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-UIG', NULL, NULL, 'UÍGE', 'Uíge'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (35001, 'AO-ZAI', NULL, NULL, 'ZAÍRE', 'Zaíre'); + + -- Argentina Provinces / provincias (id country=23) INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2301, '2301', '', 0, 'CATAMARCA', 'Catamarca'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2301, '2302', '', 0, 'JUJUY', 'Jujuy'); @@ -1638,25 +1660,6 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI043', NULL, NULL, 'GORIZIA', 'Gorizia'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI044', NULL, NULL, 'COASTAL–KARST', 'Coastal–Karst'); --- Provinces (postal districts) Angola (rowid country=35) -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-ABO', NULL, NULL, 'BENGO', 'Bengo'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-BGU', NULL, NULL, 'BENGUELA', 'Benguela'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-BIE', NULL, NULL, 'BIÉ', 'Bié'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CAB', NULL, NULL, 'CABINDA', 'Cabinda'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CCU', NULL, NULL, 'KUANDO KUBANGO', 'Kuando Kubango'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CNO', NULL, NULL, 'KWANZA NORTE', 'Kwanza Norte'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CUS', NULL, NULL, 'KWANZA SUL', 'Kwanza Sul'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CNN', NULL, NULL, 'CUNENE', 'Cunene'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-HUA', NULL, NULL, 'HUAMBO', 'Huambo'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-HUI', NULL, NULL, 'HUÍLA', 'Huila'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-LUA', NULL, NULL, 'LUANDA', 'Luanda'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-LNO', NULL, NULL, 'LUNDA-NORTE', 'Lunda-Norte'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-LSU',NULL, NULL, 'LUNDA-SUL', 'Lunda-Sul'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-MAL', NULL, NULL, 'MALANGE', 'Malange'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-MOX', NULL, NULL, 'MOXICO', 'Moxico'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-NAM', NULL, NULL, 'NAMÍBE', 'Namíbe'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-UIG', NULL, NULL, 'UÍGE', 'Uíge'); -INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-ZAI', NULL, NULL, 'ZAÍRE', 'Zaíre'); -- Provinces Taiwan (rowid country=886) INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KLU', 'KLU', NULL, '基隆市'); From 8f53ca17edaed9747bc2c61b439b2b6f16df010a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:35:40 +0200 Subject: [PATCH 10/29] Update workstation_document.php $help_url = 'EN:Module_Workstation'; --- htdocs/workstation/workstation_document.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index a85dd8e0e31..2c1a9906c8e 100755 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -97,8 +97,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $title = $langs->trans("Workstation").' - '.$langs->trans("Files"); -$help_url = ''; -//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; + +$help_url = 'EN:Module_Workstation'; + llxHeader('', $title, $help_url); if ($object->id) { From 13b586f0b9ecc1638d21a818edad485786cfa27c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:38:43 +0200 Subject: [PATCH 11/29] Update workstation_list.php $help_url = 'EN:Module_Workstation'; llxHeader('', $title, $help_url); --- htdocs/workstation/workstation_list.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 7803139ef6d..59dbfc658d3 100755 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -213,10 +213,13 @@ $formresource = new FormResource($db); $now = dol_now(); -//$help_url="EN:Module_Workstation|FR:Module_Workstation_FR|ES:Módulo_Workstation"; -$help_url = ''; $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Workstations")); +//$help_url="EN:Module_Workstation|FR:Module_Workstation_FR|ES:Módulo_Workstation"; +$help_url = 'EN:Module_Workstation'; + +llxHeader('', $title, $help_url); + // Build and execute select // -------------------------------------------------------------------- From a745aad24ba5c0ecf0343e7fde48b8008b3887bd Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:40:22 +0200 Subject: [PATCH 12/29] Update workstation_note.php $help_url = 'EN:Module_Workstation'; --- htdocs/workstation/workstation_note.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php index 6cc6a36a3fd..f2fa055102a 100755 --- a/htdocs/workstation/workstation_note.php +++ b/htdocs/workstation/workstation_note.php @@ -75,8 +75,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, $form = new Form($db); -//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; -$help_url = ''; +$help_url = 'EN:Module_Workstation'; + llxHeader('', $langs->trans('Workstation'), $help_url); if ($id > 0 || !empty($ref)) { From b988c5973f42db9c3b30292f66306cd0d7ba5a6c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:41:49 +0200 Subject: [PATCH 13/29] Update workstation_agenda.php $help_url = 'EN:Module_Workstation'; --- htdocs/workstation/workstation_agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 385aa3c41f1..8096aa3d771 100755 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -125,7 +125,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; - $help_url = ''; + $help_url = 'EN:Module_Workstation'; llxHeader('', $title, $help_url); if (!empty($conf->notification->enabled)) { From acdbd2d1722e7691d194617019c9830bb78df2f4 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:48:23 +0200 Subject: [PATCH 14/29] Create index.html --- htdocs/debugbar/class/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/debugbar/class/index.html diff --git a/htdocs/debugbar/class/index.html b/htdocs/debugbar/class/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/debugbar/class/index.html @@ -0,0 +1 @@ + From 58dda89b7abe5244cac8cc2ee592472377d0c299 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:49:00 +0200 Subject: [PATCH 15/29] Create index.html --- htdocs/debugbar/class/DataCollector/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/debugbar/class/DataCollector/index.html diff --git a/htdocs/debugbar/class/DataCollector/index.html b/htdocs/debugbar/class/DataCollector/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/index.html @@ -0,0 +1 @@ + From fbc0a0fce78388f2dead553ec63443a476991735 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:50:04 +0200 Subject: [PATCH 16/29] Create index.html --- htdocs/debugbar/js/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/debugbar/js/index.html diff --git a/htdocs/debugbar/js/index.html b/htdocs/debugbar/js/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/debugbar/js/index.html @@ -0,0 +1 @@ + From 828345b69f8007ff7176de3131c73c0bb8fe9f9d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 20:58:08 +0200 Subject: [PATCH 17/29] Update contact.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones|DE:Modul_Lieferungen'; llxHeader('', $langs->trans('Order'), $help_url); --- htdocs/expedition/contact.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 9d5b7c4a8af..cd9febc685d 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -121,7 +121,10 @@ elseif ($action == 'setaddress' && $user->rights->expedition->creer) * View */ -llxHeader('', $langs->trans('Order'), 'EN:Customers_Orders|FR:expeditions_Clients|ES:Pedidos de clientes'); + +$help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones|DE:Modul_Lieferungen'; + +llxHeader('', $langs->trans('Order'), $help_url); $form = new Form($db); $formcompany = new FormCompany($db); From 769ce7165049e79762b842b7f56e39ca85cd7978 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 21:04:53 +0200 Subject: [PATCH 18/29] Create index.html --- scripts/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 scripts/index.html diff --git a/scripts/index.html b/scripts/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/scripts/index.html @@ -0,0 +1 @@ + From 62129c722a977e8cd819797d6c3f3833a4d5181c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 21:39:25 +0200 Subject: [PATCH 19/29] Update README --- build/sitemap/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/sitemap/README b/build/sitemap/README index b98b5cc48d8..a06bd58f259 100644 --- a/build/sitemap/README +++ b/build/sitemap/README @@ -1,5 +1,5 @@ # Format of sitemap file is available at -# http://www.sitemaps.org/protocol.html +# https://www.sitemaps.org/protocol.html # To build a sitemap from urllist-bing.txt, run # google-sitemapgen --config=config-bing.xml --testing From cadef101dbaaacac02b03898dcb5fd2feae6da39 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Apr 2021 21:40:33 +0200 Subject: [PATCH 20/29] Fix var name --- htdocs/core/boxes/box_members_by_type.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 5bc05b6fabd..c961ffe3f4a 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -93,7 +93,7 @@ class box_members_by_type extends ModeleBoxes if ($user->rights->adherent->lire) { $MembersToValidate = array(); $MembersValidated = array(); - $MemberUpToDate = array(); + $MembersUpToDate = array(); $MembersExcluded = array(); $MembersResiliated = array(); @@ -164,7 +164,7 @@ class box_members_by_type extends ModeleBoxes $i = 0; while ($i < $num2) { $objp = $this->db->fetch_object($result); - $MemberUpToDate[$objp->fk_adherent_type] = $objp->somme; + $MembersUpToDate[$objp->fk_adherent_type] = $objp->somme; $i++; } $this->db->free($result); @@ -215,12 +215,12 @@ class box_members_by_type extends ModeleBoxes ); $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => (isset($MembersValidated[$key]) && ($MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) > 0) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : '') . ' ' . $staticmember->LibStatut(1, 1, 0, 3), + 'text' => (isset($MembersValidated[$key]) && ($MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) > 0) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : '') . ' ' . $staticmember->LibStatut(1, 1, 0, 3), 'asis' => 1, ); $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => (isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key] : '') . ' ' . $staticmember->LibStatut(1, 1, $now, 3), + 'text' => (isset($MembersUpToDate[$key]) && $MembersUpToDate[$key] > 0 ? $MembersUpToDate[$key] : '') . ' ' . $staticmember->LibStatut(1, 1, $now, 3), 'asis' => 1, ); $this->info_box_contents[$line][] = array( From 05bc027f7cf0d7dfd69d067fcb89e9e08c70e115 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 21:42:02 +0200 Subject: [PATCH 21/29] Update htmldoc_en.book --- build/pdf/htmldoc_en.book | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pdf/htmldoc_en.book b/build/pdf/htmldoc_en.book index f6c407f1bd2..5757128c7f5 100644 --- a/build/pdf/htmldoc_en.book +++ b/build/pdf/htmldoc_en.book @@ -1,4 +1,4 @@ #HTMLDOC 1.8.27 -t pdf14 -f "../../doc/dolibarr_en.pdf" --webpage --no-title --logoimage "../../doc/images/dolibarr_256x256.png" --linkcolor #2200c0 --linkstyle plain --size Universal --left 0.30in --right 0.30in --top 0.40in --bottom 0.30in --header ... --header1 ... --footer c/d --nup 1 --tocheader ... --tocfooter ... --portrait --color --no-pscommands --no-xrxcomments --compression=9 --jpeg=50 --fontsize 10.0 --fontspacing 1.0 --headingfont Helvetica --bodyfont Helvetica --headfootsize 9.0 --headfootfont Helvetica --charset iso-8859-1 --links --no-embedfonts --pagemode document --pagelayout single --firstpage p1 --pageeffect none --pageduration 10 --effectduration 1.0 --no-encryption --permissions all --owner-password "" --user-password "" --browserwidth 680 --no-strict --no-overflow -http://wiki.dolibarr.org/index.php/Main_Page -http://wiki.dolibarr.org/index.php/What_Dolibarr_Do +https://wiki.dolibarr.org/index.php/Home +https://wiki.dolibarr.org/index.php/What_Dolibarr_Does From e0cb1752083e189c492e1d05e64e37a2d1891911 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Apr 2021 21:49:21 +0200 Subject: [PATCH 22/29] Doxygen --- htdocs/projet/class/project.class.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 7fc9646c489..ddbb92fc668 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -111,22 +111,32 @@ class Project extends CommonObject public $budget_amount; /** - * @var boolean Use to bill task spend time + * @var integer Can use projects to follow opportunities + */ + public $usage_opportunity; + + /** + * @var integer Can follow tasks on project and enter time spent on it + */ + public $usage_task; + + /** + * @var integer Use to bill task spend time */ public $usage_bill_time; // Is the time spent on project must be invoiced or not /** - * @var boolean Event organization: Use Event Organization + * @var integer Event organization: Use Event Organization */ public $usage_organize_event; /** - * @var boolean Event organization: Allow unknown people to suggest conferences + * @var integer Event organization: Allow unknown people to suggest new conferences */ public $accept_conference_suggestions; /** - * @var boolean Event organization: Allow unknown people to suggest booth + * @var integer Event organization: Allow unknown people to suggest new booth */ public $accept_booth_suggestions; From 38f1ce183143645373f9591bb1b1adcecd61f3fe Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 21:54:12 +0200 Subject: [PATCH 23/29] Update generate-product.php --- dev/initdata/generate-product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php index 97b02fa3ac9..ea40710824c 100755 --- a/dev/initdata/generate-product.php +++ b/dev/initdata/generate-product.php @@ -102,8 +102,8 @@ for ($s = 0; $s < GEN_NUMBER_PRODUIT; $s++) { $produit->ref = ($produit->type?'S':'P').time().$s; $produit->label = 'Label '.time().$s; $produit->description = 'Description '.time().$s; - $produit->price = mt_rand(1, 1000); - $produit->tva_tx = "19.6"; + $produit->price = mt_rand(1, 999.99); + $produit->tva_tx = "20.0"; $ret=$produit->create($user); if ($ret < 0) { print "Error $ret - ".$produit->error."\n"; From 3f090a39decc51b55508ad0c93661308d912a2fc Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 22:05:16 +0200 Subject: [PATCH 24/29] Update company_ids.txt Spain URL invalid --- dev/resources/iso-normes/company_ids.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/resources/iso-normes/company_ids.txt b/dev/resources/iso-normes/company_ids.txt index 69c2af1d665..586628a4aac 100644 --- a/dev/resources/iso-normes/company_ids.txt +++ b/dev/resources/iso-normes/company_ids.txt @@ -1,2 +1,2 @@ -Spain https://incwell.eu/en/company-formation-spain/ + France https://www.economie.gouv.fr/entreprises/numeros-identification-entreprise From 54ae4655a44a62328db85bddc845ba5a7d6324f3 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Apr 2021 22:08:26 +0200 Subject: [PATCH 25/29] Update README-DE.md --- doc/user/README-DE.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/user/README-DE.md b/doc/user/README-DE.md index ea9458f4563..4c7a635a522 100644 --- a/doc/user/README-DE.md +++ b/doc/user/README-DE.md @@ -6,7 +6,10 @@ Benutzeranleitung -------------------------------- Alle Dolibarr-Informationen sind online verfuegbar ueber die Webseiten: -https://www.dolibarr.de -oder -https://www.dolibarr.org -https://wiki.dolibarr.org + + +https://www.dolibarr.de (de) oder https://www.dolibarr.org (intl) + + +https://wiki.dolibarr.org/index.php/Hauptseite (de) + From 51ee0b07c01d1cf133a3838fa5fdafd9d990aeff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Apr 2021 22:32:52 +0200 Subject: [PATCH 26/29] Removed duplicate comment --- htdocs/api/class/api.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 8ddcf9f2dc3..356caa24ec2 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -237,8 +237,6 @@ class DolibarrApi // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** - * Check user access to a resource - * * Check access by user to a given resource * * @param string $resource element to check From 5ce9bc5801968e64c902860e89e8d2b8acaad9c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Apr 2021 23:23:44 +0200 Subject: [PATCH 27/29] FIX #yogosha5748 --- htdocs/core/lib/security.lib.php | 4 ++- htdocs/salaries/card.php | 33 +++++++++++-------- htdocs/salaries/document.php | 20 ++++++------ htdocs/salaries/info.php | 8 ++++- htdocs/salaries/list.php | 14 ++++----- htdocs/salaries/paiement_salary.php | 42 +++++++++++++++---------- htdocs/salaries/payment_salary/card.php | 3 +- htdocs/salaries/payments.php | 12 ++++--- 8 files changed, 81 insertions(+), 55 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 57e3db85402..b6b71f6d8a6 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -563,6 +563,8 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand foreach ($featuresarray as $feature) { $sql = ''; + //var_dump($feature); + // For backward compatibility if ($feature == 'member') { $feature = 'adherent'; @@ -574,7 +576,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $feature = 'projet_task'; } - $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'website'); // Test on entity only (Objects with no link to company) + $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salary', 'website'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for societe object $checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet', 'project'); // Test for project object diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index afd152fb785..323e2c74c5a 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -45,6 +45,7 @@ if (!empty($conf->projet->enabled)) { } $id = GETPOSTINT('id'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $accountid = GETPOST('accountid', 'int') > 0 ? GETPOST('accountid', 'int') : 0; @@ -63,13 +64,6 @@ $dateep = dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday $label = GETPOST('label', 'alphanohtml'); $fk_user = GETPOSTINT('userid'); -// Security check -$socid = GETPOSTINT('socid'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'salaries', '', '', ''); - $object = new Salary($db); $extrafields = new ExtraFields($db); @@ -79,6 +73,18 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('salarycard', 'globalcard')); +$object = new Salary($db); +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); +} + +// Security check +$socid = GETPOSTINT('socid'); +if ($user->socid) { + $socid = $user->socid; +} +restrictedArea($user, 'salaries', $object->id, 'salary', ''); + /** * Actions @@ -885,21 +891,22 @@ if ($id) { /* * Action bar */ + print '
'."\n"; if ($action != 'edit') { // Reopen if ($object->paye && $user->rights->salaries->write) { - print ""; + print ""; } // Edit if ($object->paye == 0 && $user->rights->salaries->write) { - print ""; + print ""; } // Emit payment if ($object->paye == 0 && ((price2num($object->amount) < 0 && price2num($resteapayer, 'MT') < 0) || (price2num($object->amount) > 0 && price2num($resteapayer, 'MT') > 0)) && $user->rights->salaries->write) { - print ""; + print ""; } // Classify 'paid' @@ -909,16 +916,16 @@ if ($id) { || (round($resteapayer) >= 0 && $object->amount < 0) ) && $user->rights->salaries->write) { - print ""; + print ""; } // Clone if ($user->rights->salaries->write) { - print ""; + print ""; } if (!empty($user->rights->salaries->delete) && empty($totalpaye)) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 9534d074d5f..5772de8af3a 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -44,14 +44,6 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -$socid = GETPOST("socid", "int"); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'salaries', '', '', ''); - - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -70,13 +62,21 @@ if (!$sortfield) { $sortfield = "name"; } - $object = new Salary($db); -$object->fetch($id, $ref); +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); +} $upload_dir = $conf->salaries->dir_output.'/'.dol_sanitizeFileName($object->id); $modulepart = 'salaries'; +// Security check +$socid = GETPOSTINT('socid'); +if ($user->socid) { + $socid = $user->socid; +} +restrictedArea($user, 'salaries', $object->id, 'salary', ''); + /* * Actions diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index e0e6aec7f3c..1b81a80189f 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -33,14 +33,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array("compta", "bills", "users", "salaries", "hrm")); $id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); +$object = new Salary($db); +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); +} + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'salaries', '', '', ''); +restrictedArea($user, 'salaries', $object->id, 'salary', ''); /* diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index d60a583c3f8..7c4f0a2cec3 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -108,13 +108,6 @@ if (!GETPOST('search_type_id', 'int')) { $childids = $user->getAllChildIds(1); -// Security check -$socid = GETPOST("socid", "int"); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'salaries', '', '', ''); - // Initialize array of search criterias $search_all = GETPOST("search_all", 'alpha'); $search = array(); @@ -161,6 +154,13 @@ $permissiontoread = $user->rights->salaries->read; $permissiontoadd = $user->rights->salaries->write; $permissiontodelete = $user->rights->salaries->delete; +// Security check +$socid = GETPOST("socid", "int"); +if ($user->socid) { + $socid = $user->socid; +} +restrictedArea($user, 'salaries', '', 'salary', ''); + /* * Actions diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 6c282eac94d..2f4a0c85905 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -18,9 +18,9 @@ */ /** - * \file htdocs/compta/paiement_charge.php - * \ingroup tax - * \brief Page to add payment of a tax + * \file htdocs/compta/paiement_salary.php + * \ingroup salary + * \brief Page to add payment of a salary */ require '../main.inc.php'; @@ -31,16 +31,25 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->load("bills"); -$chid = GETPOST("id", 'int'); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); + +$id = GETPOSTINT('id'); +$ref = GETPOST('ref', 'alpha'); $amounts = array(); +$object = new Salary($db); +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); +} + // Security check -$socid = 0; +$socid = GETPOST("socid", "int"); if ($user->socid > 0) { $socid = $user->socid; } +restrictedArea($user, 'salaries', $object->id, 'salary', ''); /* @@ -51,7 +60,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $error = 0; if ($cancel) { - $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$chid; + $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$id; header("Location: ".$loc); exit; } @@ -96,7 +105,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y // Create a line of payments $paiement = new PaymentSalary($db); - $paiement->chid = $chid; + $paiement->chid = $id; $paiement->datepaye = $datepaye; $paiement->amounts = $amounts; // Tableau de montant $paiement->paiementtype = GETPOST("paiementtype", 'alphanohtml'); @@ -124,7 +133,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y if (!$error) { $db->commit(); - $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$chid; + $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$id; header('Location: '.$loc); exit; } else { @@ -139,15 +148,16 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y * View */ -llxHeader(); - $form = new Form($db); +$help_url = ''; + +llxHeader('', '', $help_url); + +$salary = $object; // Formulaire de creation d'un paiement de charge if ($action == 'create') { - $salary = new Salary($db); // Salary to pay - $salary->fetch($chid); $salary->accountid = $salary->fk_account ? $salary->fk_account : $salary->accountid; $salary->paiementtype = $salary->mode_reglement_id ? $salary->mode_reglement_id : $salary->paiementtype; @@ -171,15 +181,15 @@ if ($action == 'create') { print '
'; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print dol_get_fiche_head(); print ''; - print ''; + print ''; print '\n"; print '\n"; print '\n"; @@ -188,7 +198,7 @@ if ($action == 'create') { $sql = "SELECT sum(p.amount) as total"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; - $sql .= " WHERE p.fk_salary = ".((int) $chid); + $sql .= " WHERE p.fk_salary = ".((int) $id); $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php index 51f80b23efd..ae711719585 100644 --- a/htdocs/salaries/payment_salary/card.php +++ b/htdocs/salaries/payment_salary/card.php @@ -41,14 +41,13 @@ $id = GETPOST("id", 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); if ($user->socid) $socid = $user->socid; -// TODO ajouter regle pour restreindre acces paiement -//$result = restrictedArea($user, 'facture', $id,''); $object = new PaymentSalary($db); if ($id > 0) { $result = $object->fetch($id); if (!$result) dol_print_error($db, 'Failed to get payment id '.$id); } +restrictedArea($user, 'salaries', $object->fk_salary, 'salary', ''); // $object is payment of salary /* diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index 09c90854f22..d5b8f009707 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -97,11 +97,6 @@ if (!GETPOST('search_type_id', 'int')) { $childids = $user->getAllChildIds(1); -// Security check -$socid = GETPOST("socid", "int"); -if ($user->socid) $socid = $user->socid; -$result = restrictedArea($user, 'salaries', '', '', ''); - // Initialize array of search criterias $search_all = GETPOST("search_all", 'alpha'); $search = array(); @@ -119,6 +114,13 @@ $permissiontoread = $user->rights->salaries->read; $permissiontoadd = $user->rights->salaries->write; $permissiontodelete = $user->rights->salaries->delete; +// Security check +$socid = GETPOST("socid", "int"); +if ($user->socid > 0) { + $socid = $user->socid; +} +restrictedArea($user, 'salaries', 0, 'salary', ''); + /* * Actions From 858693d6319b9eebcf72567f48b74030d4052b95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Apr 2021 01:39:08 +0200 Subject: [PATCH 28/29] CSS --- htdocs/salaries/payments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index d5b8f009707..f0602e88a5c 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -518,7 +518,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } // Amount - print ''; + print ''; if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; $totalarray['val']['totalttcfield'] += $obj->amount; From 231f4418766e017463f8571cff716962328fecf7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Apr 2021 02:11:16 +0200 Subject: [PATCH 29/29] Look and feel v14 --- htdocs/compta/sociales/card.php | 17 ++++++----- htdocs/compta/sociales/document.php | 13 ++++----- htdocs/compta/sociales/info.php | 9 ++++-- htdocs/compta/sociales/list.php | 16 +++++------ htdocs/compta/sociales/payments.php | 34 +++++++++++----------- htdocs/compta/tva/card.php | 20 ++++++++----- htdocs/compta/tva/clients.php | 31 ++++++++++---------- htdocs/compta/tva/document.php | 15 +++++----- htdocs/compta/tva/index.php | 17 +++++------ htdocs/compta/tva/info.php | 7 ++--- htdocs/compta/tva/list.php | 16 +++++------ htdocs/compta/tva/payments.php | 21 ++++++++------ htdocs/compta/tva/quadri_detail.php | 4 ++- htdocs/fourn/facture/list.php | 29 ++++++++++--------- htdocs/fourn/paiement/list.php | 44 ++++++++++++++--------------- 15 files changed, 156 insertions(+), 137 deletions(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index e4ac225a624..b2ac294021c 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -56,20 +56,23 @@ $label = GETPOST('label', 'alpha'); $actioncode = GETPOST('actioncode'); $fk_user = GETPOST('userid', 'int'); +$object = new ChargeSociales($db); +if ($id > 0) { + $object->fetch($id); +} + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges'); +$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges'); -$object = new ChargeSociales($db); -/* *************************************************************************** */ -/* */ -/* Actions */ -/* */ -/* *************************************************************************** */ + +/* + * Actions + */ // Classify paid if ($action == 'confirm_paid' && $user->rights->tax->charges->creer && $confirm == 'yes') { diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 542804b866c..129f7b7d685 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -45,13 +45,6 @@ $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges'); - - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -79,6 +72,12 @@ if ($id > 0) { $upload_dir = $conf->tax->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart = 'tax'; +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges'); + /* * Actions diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 1ab9b9b0ada..eefd667b964 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -36,14 +36,17 @@ $langs->loadLangs(array('compta', 'bills')); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); +$object = new ChargeSociales($db); +if ($id > 0) { + $object->fetch($id); +} + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges'); - -$object = new ChargeSociales($db); +$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges'); /* diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 0ecdaee87a5..ffebc7dcc73 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -28,14 +28,6 @@ */ require '../../main.inc.php'; - -// Security check -$socid = isset($_GET["socid"]) ? $_GET["socid"] : ''; -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax', '', '', 'charges'); - require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; @@ -125,6 +117,14 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $hookmanager->initHooks(array('sclist')); $object = new ChargeSociales($db); +// Security check +$socid = GETPOST("socid", 'int'); +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'tax', '', 'chargesociales', 'charges'); + + /* * Actions */ diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index e8e4102b5cc..b2ee4ffce5e 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -38,7 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; - $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array @@ -47,12 +46,6 @@ $hookmanager->initHooks(array('specialexpensesindex')); // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'hrm')); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|'); - $year = GETPOST("year", 'int'); $search_sc_type = GETPOST('search_sc_type', 'int'); @@ -60,7 +53,7 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { +if (empty($page) || $page < 0) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; @@ -73,9 +66,11 @@ if (!$sortorder) { $sortorder = "DESC"; } -if (empty($conf->tax->enabled) || empty($user->rights->tax->charges->lire)) { - accessforbidden(); +// Security check +if ($user->socid) { + $socid = $user->socid; } +$result = restrictedArea($user, 'tax', '', 'chargesociales', 'charges'); /* @@ -104,8 +99,9 @@ $accountlinestatic = new AccountLine($db); $formsocialcontrib = new FormSocialContrib($db); $title = $langs->trans("SocialContributionsPayments"); +$help_url = ''; -llxHeader('', $title); +llxHeader('', $title, $help_url); $param = ''; @@ -300,10 +296,12 @@ while ($i < min($num, $limit)) { } // Type payment - print ''; print ''; @@ -311,12 +309,12 @@ while ($i < min($num, $limit)) { // Account if (!empty($conf->banque->enabled)) { // Bank transaction - print ''; - print ''; } + // Expected to pay - print ''; + print ''; + // Paid print ''; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index bbf4bc9ac2b..da07472719b 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -57,18 +57,21 @@ if (empty($refund)) { $datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); $datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); +$object = new Tva($db); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('taxvatcard', 'globalcard')); + +if ($id > 0) { + $object->fetch($id); +} // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); - -$object = new Tva($db); - -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('taxvatcard', 'globalcard')); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); /** @@ -330,6 +333,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char } } + /* * View */ @@ -338,7 +342,8 @@ $form = new Form($db); $title = $langs->trans("VAT")." - ".$langs->trans("Card"); $help_url = ''; -llxHeader("", $title, $helpurl); + +llxHeader("", $title, $help_url); if ($id) { @@ -438,6 +443,7 @@ if ($action == 'create') { if (!empty($conf->banque->enabled)) { print ''; } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 7860f7e3c02..f7b860cd792 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -65,7 +65,7 @@ $socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); @@ -496,14 +496,14 @@ if (!is_array($x_coll) || !is_array($x_paye)) { // Total HT if ($modetax != 1) { - print ''; + print ''; } // Payment @@ -523,7 +523,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } - print price(price2num($fields['payment_amount'], 'MT')); + print ''.price(price2num($fields['payment_amount'], 'MT')).''; if (isset($fields['payment_amount'])) { print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; } @@ -532,17 +532,17 @@ if (!is_array($x_coll) || !is_array($x_paye)) { } // Total collected - print ''; + print ''; // VAT - print ''; + print ''; print ''; $subtot_coll_total_ht += $temp_ht; @@ -550,6 +550,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $x_coll_sum += $temp_vat; } } + // Total customers for this vat rate print ''; print ''; @@ -686,14 +687,14 @@ if (!is_array($x_coll) || !is_array($x_paye)) { // Total HT if ($modetax != 1) { - print ''; + print ''; } // Payment @@ -713,7 +714,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } - print price(price2num($fields['payment_amount'], 'MT')); + print ''.price(price2num($fields['payment_amount'], 'MT')).''; if (isset($fields['payment_amount'])) { print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; } @@ -722,17 +723,17 @@ if (!is_array($x_coll) || !is_array($x_paye)) { } // VAT paid - print ''; + print ''; // VAT - print ''; + print ''; print ''; $subtot_paye_total_ht += $temp_ht; diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 38d88fb3d12..ea06d0dca06 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -46,13 +46,6 @@ $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax', '', 'vat', 'charges'); - - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -71,8 +64,8 @@ if (!$sortfield) { $sortfield = "name"; } - $object = new Tva($db); + if ($id > 0) { $object->fetch($id); } @@ -80,6 +73,12 @@ if ($id > 0) { $upload_dir = $conf->tax->dir_output.'/vat/'.dol_sanitizeFileName($object->ref); $modulepart = 'tax-vat'; +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); + /* * Actions diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 63b834d7821..e1ac3f96a2d 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -62,7 +62,7 @@ $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); /** @@ -106,8 +106,8 @@ function pt($db, $sql, $date) if ($obj->mode == 'claimed' && !empty($previousmode)) { print ''; print '\n"; - print '\n"; - print '\n"; + print '\n"; + print '\n"; print "\n"; $amountclaimed = 0; @@ -126,8 +126,8 @@ function pt($db, $sql, $date) if ($obj->mode == 'paid') { print ''; print '\n"; - print '\n"; - print '\n"; + print '\n"; + print '\n"; print "\n"; $amountclaimed = 0; $amountpaid = 0; @@ -438,7 +438,7 @@ if ($refresh === true) { $x_coll_sum += $temp_vat; } } - print ''; + print ''; $x_paye_sum = 0; foreach (array_keys($x_paye) as $rate) { @@ -478,7 +478,7 @@ if ($refresh === true) { $x_paye_sum += $temp_vat; } } - print ''; + print ''; $subtotalcoll = $subtotalcoll + $x_coll_sum; $subtotalpaye = $subtotalpaye + $x_paye_sum; @@ -487,10 +487,11 @@ if ($refresh === true) { $total = $total + $diff; $subtotal = price2num($subtotal + $diff, 'MT'); - print '' . "\n"; + print '' . "\n"; print "\n"; print "\n"; + // Total $i++; $m++; if ($i > 2) { diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php index fb3d0c62d86..96eed7ce20b 100644 --- a/htdocs/compta/tva/info.php +++ b/htdocs/compta/tva/info.php @@ -32,15 +32,14 @@ $langs->loadLangs(array('compta', 'bills')); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); +$object = new Tva($db); + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); - -$object = new Tva($db); - +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); /* diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index ac9e7b55ecd..17237732cea 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -28,13 +28,6 @@ require '../../main.inc.php'; -// Security check -$socid = GETPOST('socid', 'int'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax', '', '', 'charges'); - require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -99,6 +92,13 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $hookmanager->initHooks(array('salestaxeslist')); $object = new Tva($db); +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); + /* * Actions @@ -509,7 +509,7 @@ while ($i < min($num, $limit)) { // Amount if (!empty($arrayfields['t.amount']['checked'])) { $total = $total + $obj->amount; - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 134f840d196..57e70e70a3d 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -38,12 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|'); - $mode = GETPOST("mode", 'alpha'); $year = GETPOST("year", 'int'); $filtre = GETPOST("filtre", 'alpha'); @@ -68,6 +62,15 @@ if (!$sortorder) { $sortorder = "DESC"; } +$object = new Tva($db); + +// Security check +if ($user->socid) { + $socid = $user->socid; +} +//$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|'); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); + /* * View @@ -233,11 +236,11 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { // Expected to pay print ''; // Paid - print ''; + print ''; print ''; $total = $total + $obj->total; @@ -245,6 +248,8 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $totalpaye = $totalpaye + $obj->totalpaye; $i++; } + + // Total print ''; print ''; // A total here has no sense print ''; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index acf0bec8899..4b44959bc1a 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -66,12 +66,14 @@ if (empty($modetax)) { $modetax = 0; } +$object = new Tva($db); + // Security check $socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'tax', '', '', 'charges'); +$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); /* diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 3efc19f86cc..b5b6fc1c783 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1042,7 +1042,7 @@ if ($resql) { } print ''; $formother->select_year($year_lim ? $year_lim : -1, 'year_lim', 1, 20, 5); - print '
'.$langs->trans("Late"); + print '
'; print ''; } // Project @@ -1541,7 +1541,7 @@ if ($resql) { // Amount HT if (!empty($arrayfields['f.total_ht']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1552,7 +1552,7 @@ if ($resql) { } // Amount VAT if (!empty($arrayfields['f.total_vat']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1563,7 +1563,7 @@ if ($resql) { } // Amount LocalTax1 if (!empty($arrayfields['f.total_localtax1']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1574,7 +1574,7 @@ if ($resql) { } // Amount LocalTax2 if (!empty($arrayfields['f.total_localtax2']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1585,7 +1585,7 @@ if ($resql) { } // Amount TTC if (!empty($arrayfields['f.total_ttc']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1612,7 +1612,7 @@ if ($resql) { } if (!empty($arrayfields['dynamount_payed']['checked'])) { - print ''; // TODO Use a denormalized field + print ''; // TODO Use a denormalized field if (!$i) { $totalarray['nbfield']++; } @@ -1652,27 +1652,27 @@ if ($resql) { } // Amount HT if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } // Amount VAT if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } // Amount TTC if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { - print ''; // TODO Use a denormalized field + print ''; // TODO Use a denormalized field if (!$i) { $totalarray['nbfield']++; } @@ -1680,9 +1680,9 @@ if ($resql) { // Pending amount if (!empty($arrayfields['multicurrency_rtp']['checked'])) { - print ''; // TODO Use a denormalized field + print ''; // TODO Use a denormalized field if (!$i) { $totalarray['nbfield']++; } @@ -1695,6 +1695,7 @@ if ($resql) { $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; + // Date creation if (!empty($arrayfields['f.datec']['checked'])) { print ''; + print ''; if (!$i) { $totalarray['nbfield']++; }
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Ref").''.$id.'
'.$langs->trans("DateStart")."".dol_print_date($salary->datesp, 'day')."
'.$langs->trans("DateEnd")."".dol_print_date($salary->dateep, 'day')."
'.$langs->trans("Label").''.$salary->label."
'.price($obj->amount).''.price($obj->amount).''; + $labelpayment = ''; if ($obj->payment_code) { - print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + $labelpayment = $langs->trans("PaymentTypeShort".$obj->payment_code); } + print ''; + print $labelpayment; print ''.$obj->num_payment.''; + print ''; $accountlinestatic->id = $obj->fk_bank; print $accountlinestatic->getNomUrl(1); print ''; + print ''; if ($obj->bid > 0) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; @@ -334,12 +332,14 @@ while ($i < min($num, $limit)) { } print ''.price($obj->total).''.price($obj->total).''; if ($obj->totalpaye) { - print price($obj->totalpaye); + print ''.price($obj->totalpaye).''; } print '
'.$langs->trans("BankAccount").''; + print img_picto('', 'bank_account', 'pictofixedwidth'); $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 1); // List of bank account available print '
'; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']); //print ' ('.round($ratiolineinvoice*100,2).'%)'; } - print ''; + print ''; $temp_ht = $fields['totalht'] * $ratiopaymentinvoice; print price(price2num($temp_ht, 'MT'), 1); - print ''; + print ''; $temp_vat = $fields['vat'] * $ratiopaymentinvoice; print price(price2num($temp_vat, 'MT'), 1); //print price($fields['vat']); - print '
'; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']); //print ' ('.round($ratiolineinvoice*100,2).'%)'; } - print ''; + print ''; $temp_ht = $fields['totalht'] * $ratiopaymentinvoice; print price(price2num($temp_ht, 'MT'), 1); - print ''; + print ''; $temp_vat = $fields['vat'] * $ratiopaymentinvoice; print price(price2num($temp_vat, 'MT'), 1); //print price($fields['vat']); - print '
'.$previousmonth."'.price($amountclaimed)."'.price($amountpaid)."'.price($amountclaimed)."'.price($amountpaid)."
'.$obj->dm."'.price($amountclaimed)."'.price($amountpaid)."'.price($amountclaimed)."'.price($amountpaid)."
' . price(price2num($x_coll_sum, 'MT')) . '' . price(price2num($x_coll_sum, 'MT')) . '' . price(price2num($x_paye_sum, 'MT')) . '' . price(price2num($x_paye_sum, 'MT')) . '' . price(price2num($diff, 'MT')) . '' . price(price2num($diff, 'MT')) . ' 
' . price($obj->amount) . '' . price($obj->amount) . ''.price($obj->total).''; + print ''; if ($obj->totalpaye) { print price($obj->totalpaye); } - print '
'.$langs->trans("Total").' '.price($obj->total_ht)."'.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_vat)."'.price($obj->total_localtax1)."'.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($obj->total_localtax2)."'.price($obj->total_ttc)."'.price($obj->total_ttc)."'.(!empty($totalpay) ?price($totalpay, 0, $langs) : ' ').''.(!empty($totalpay) ?price($totalpay, 0, $langs) : '').''.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_vat)."'.price($obj->multicurrency_total_vat)."'.price($obj->multicurrency_total_ttc)."'.price($obj->multicurrency_total_ttc)."'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : ' ').''.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '').''; - print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ' '); - print ''; + print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ''); + print ''; diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index a876f5753b9..000b5def498 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -34,28 +34,9 @@ */ require '../../main.inc.php'; - -// Security check -if ($user->socid) { - $socid = $user->socid; -} - -// doesn't work :-( -// restrictedArea($user, 'fournisseur'); - -// doesn't work :-( -// require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -// $object = new PaiementFourn($db); -// restrictedArea($user, $object->element); - -if (!$user->rights->fournisseur->facture->lire) { - accessforbidden(); -} - require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; - // Load translation files required by the page $langs->loadLangs(array('companies', 'bills', 'banks', 'compta')); @@ -120,9 +101,28 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $hookmanager->initHooks(array('paymentsupplierlist')); $object = new PaiementFourn($db); +// Security check +if ($user->socid) { + $socid = $user->socid; +} + +// doesn't work :-( +// restrictedArea($user, 'fournisseur'); +// doesn't work :-( +// require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +// $object = new PaiementFourn($db); +// restrictedArea($user, $object->element); +if (empty($conf->fournisseur->enabled)) { + accessforbidden(); +} +if (!$user->rights->fournisseur->facture->lire) { + accessforbidden(); +} + + /* -* Actions -*/ + * Actions + */ $parameters = array('socid'=>$socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -520,7 +520,7 @@ while ($i < min($num, $limit)) { // Amount if (!empty($arrayfields['p.amount']['checked'])) { - print ''.price($objp->pamount).''.price($objp->pamount).'