From b2e995279e3d95c31f37b1e7b793673b332ce746 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 25 Nov 2019 19:29:07 +0100 Subject: [PATCH 1/4] Fix takepos.lib.php to add Receipt tab and delete unnecessary takepos.lib.php --- htdocs/core/lib/takepos.lib.php | 8 ++++ htdocs/takepos/lib/takepos.lib.php | 60 ------------------------------ 2 files changed, 8 insertions(+), 60 deletions(-) delete mode 100644 htdocs/takepos/lib/takepos.lib.php diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index e3a80e5d1df..8967f4b7d27 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -37,6 +37,14 @@ function takepos_prepare_head() $head[$h][1] = $langs->trans("Parameters"); $head[$h][2] = 'setup'; $h++; + + if ($conf->global->TAKEPOS_CUSTOM_RECEIPT) + { + $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/receipt.php'; + $head[$h][1] = $langs->trans("Receipt"); + $head[$h][2] = 'receipt'; + $h++; + } $numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS); for ($i = 1; $i <= $numterminals; $i++) diff --git a/htdocs/takepos/lib/takepos.lib.php b/htdocs/takepos/lib/takepos.lib.php deleted file mode 100644 index af1ea6aa100..00000000000 --- a/htdocs/takepos/lib/takepos.lib.php +++ /dev/null @@ -1,60 +0,0 @@ -. - */ - -/** - * \file takepos/lib/takepos.lib.php - * \ingroup takepos - * \brief Library files with common functions for TakePos - */ - -/** - * Prepare admin pages header - * - * @return array - */ -function takeposAdminPrepareHead() -{ - global $langs, $conf; - - $langs->load("cashdesk"); - - $h = 0; - $head = array(); - - $head[$h][0] = dol_buildpath("/takepos/admin/setup.php", 1); - $head[$h][1] = $langs->trans("Settings"); - $head[$h][2] = 'settings'; - $h++; - $head[$h][0] = dol_buildpath("/takepos/admin/about.php", 1); - $head[$h][1] = $langs->trans("About"); - $head[$h][2] = 'about'; - $h++; - - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - //$this->tabs = array( - // 'entity:+tabname:Title:@takepos:/takepos/mypage.php?id=__ID__' - //); // to add new tab - //$this->tabs = array( - // 'entity:-tabname:Title:@takepos:/takepos/mypage.php?id=__ID__' - //); // to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos'); - - complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos', 'remove'); - - return $head; -} From 6baa1c8d4a1d99a5c0a8cd9a132cec541cc2cab4 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 25 Nov 2019 23:32:40 +0100 Subject: [PATCH 2/4] Fix travis --- htdocs/core/lib/takepos.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index 8967f4b7d27..dc86853859e 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -37,7 +37,7 @@ function takepos_prepare_head() $head[$h][1] = $langs->trans("Parameters"); $head[$h][2] = 'setup'; $h++; - + if ($conf->global->TAKEPOS_CUSTOM_RECEIPT) { $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/receipt.php'; From 77a300c9ae877c2b0eb209d3fddeec1162cc21ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 00:20:40 +0100 Subject: [PATCH 3/4] doxygen --- htdocs/core/class/events.class.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 4c728256413..f6537bf6528 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -53,7 +53,14 @@ class Events // extends CommonObject */ public $error=''; + /** + * @var int timestamp + */ public $tms; + + /** + * @var string Type + */ public $type; /** @@ -63,8 +70,14 @@ class Events // extends CommonObject public $dateevent; + /** + * @var string IP + */ public $ip; + /** + * @var string User agent + */ public $user_agent; /** @@ -179,7 +192,7 @@ class Events // extends CommonObject public function update($user = null, $notrigger = 0) { // Clean parameters - $this->id=trim($this->id); + $this->id = (int) $this->id; $this->type=trim($this->type); $this->description=trim($this->description); @@ -234,7 +247,7 @@ class Events // extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; + $this->id = $obj->rowid; $this->tms = $this->db->jdate($obj->tms); $this->type = $obj->type; $this->entity = $obj->entity; From 1ccf0808d0757c099f825bdeb084dc3bce9911ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 26 Nov 2019 00:28:26 +0100 Subject: [PATCH 4/4] doxygen --- htdocs/core/lib/ajax.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 8991e1ad23b..d2626414ba6 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -326,7 +326,7 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option = '', $minLen * @param string $message Message of dialog box * @param int $w Width of dialog box * @param int $h height of dialog box - * @return void + * @return string */ function ajax_dialog($title, $message, $w = 350, $h = 150) {