Dolibarrize

This commit is contained in:
Laurent Destailleur 2018-03-11 16:00:18 +01:00
parent 0ac1d8b226
commit e393621f2f
6 changed files with 29 additions and 26 deletions

View File

@ -224,7 +224,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
$object->dao->label .= $object->dao->origin_email . ' <small>(' . $langs->trans("TicketEmailOriginIssuer") . ')</small>'; $object->dao->label .= $object->dao->origin_email . ' <small>(' . $langs->trans("TicketEmailOriginIssuer") . ')</small>';
} }
$linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> '; $linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
$object->dao->ticketsup_banner_tab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback); $object->dao->ticketsupBannerTab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback);
print '<div class="fichecenter"><div class="fichehalfleft">'; print '<div class="fichecenter"><div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';

View File

@ -475,7 +475,7 @@ class ActionsTicketsup
// Set parent company // Set parent company
if ($action == 'set_thirdparty' && $user->rights->societe->creer) { if ($action == 'set_thirdparty' && $user->rights->societe->creer) {
if ($this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { if ($this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) {
$result = $this->dao->set_customer(GETPOST('editcustomer', 'int')); $result = $this->dao->setCustomer(GETPOST('editcustomer', 'int'));
$url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha'); $url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha');
header("Location: " . $url); header("Location: " . $url);
exit(); exit();
@ -1329,7 +1329,7 @@ class ActionsTicketsup
* @param int $fieldid Id * @param int $fieldid Id
* @return int 0 * @return int 0
*/ */
public function load_previous_next_ref($filter, $fieldid) function load_previous_next_ref($filter, $fieldid)
{ {
$this->getInstanceDao(); $this->getInstanceDao();
return $this->dao->load_previous_next_ref($filter, $fieldid); return $this->dao->load_previous_next_ref($filter, $fieldid);

View File

@ -1052,7 +1052,7 @@ class Ticketsup extends CommonObject
* *
* @return int Nb lignes chargees, 0 si deja chargees, <0 si ko * @return int Nb lignes chargees, 0 si deja chargees, <0 si ko
*/ */
public function load_cache_categories_tickets() function load_cache_categories_tickets()
{ {
global $langs; global $langs;
@ -1129,9 +1129,10 @@ class Ticketsup extends CommonObject
} }
/** /**
* \brief Return status label of object * Return status label of object
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto *
* \return string Label * @param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/ */
public function getLibStatut($mode = 0) public function getLibStatut($mode = 0)
{ {
@ -1139,10 +1140,11 @@ class Ticketsup extends CommonObject
} }
/** /**
* \brief Return status label of object * Return status label of object
* \param statut id statut *
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param string $statut id statut
* \return string Label * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/ */
public function LibStatut($statut, $mode = 0) public function LibStatut($statut, $mode = 0)
{ {
@ -1324,12 +1326,13 @@ class Ticketsup extends CommonObject
return $result; return $result;
} }
/** /**
* Mark a message as read * Mark a message as read
* *
* @param User $user Object user * @param User $user Object user
* @return int <0 if KO, >0 if OK * @param int $notrigger No trigger
* @return int <0 if KO, >0 if OK
*/ */
public function markAsRead($user, $notrigger = 0) public function markAsRead($user, $notrigger = 0)
{ {
@ -1337,7 +1340,7 @@ class Ticketsup extends CommonObject
if ($this->statut != 9) { // no closed if ($this->statut != 9) { // no closed
$this->db->begin(); $this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup"; $sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup";
$sql .= " SET fk_statut = 1, date_read='" . $this->db->idate(dol_now()) . "'"; $sql .= " SET fk_statut = 1, date_read='" . $this->db->idate(dol_now()) . "'";
$sql .= " WHERE rowid = " . $this->id; $sql .= " WHERE rowid = " . $this->id;
@ -1914,13 +1917,13 @@ class Ticketsup extends CommonObject
* @param int $id Id of thirdparty to set or '' to remove * @param int $id Id of thirdparty to set or '' to remove
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function set_customer($id) public function setCustomer($id)
{ {
if ($this->id) { if ($this->id) {
$sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup"; $sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup";
$sql .= " SET fk_soc = " . ($id > 0 ? $id : "null"); $sql .= " SET fk_soc = " . ($id > 0 ? $id : "null");
$sql .= " WHERE rowid = " . $this->id; $sql .= " WHERE rowid = " . $this->id;
dol_syslog(get_class($this) . '::set_customer sql=' . $sql); dol_syslog(get_class($this) . '::setCustomer sql=' . $sql);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
return 1; return 1;
@ -2077,7 +2080,7 @@ class Ticketsup extends CommonObject
/** /**
* Return id of all contacts for ticket * Return id of all contacts for ticket
* *
* @param int $exclude_self exclude_self Exclude current user form list * @return array Array of contacts for tickets
*/ */
public function getTicketAllContacts() public function getTicketAllContacts()
{ {
@ -2236,10 +2239,10 @@ class Ticketsup extends CommonObject
* Get array of all contacts for a ticket * Get array of all contacts for a ticket
* Override method of file commonobject.class.php to add phone number * Override method of file commonobject.class.php to add phone number
* *
* @param int $statut Status of lines to get (-1=all) * @param int $statut Status of lines to get (-1=all)
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user) * @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id * @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @return array Array of contacts * @return array Array of contacts
*/ */
public function liste_contact($statut = -1, $source = 'external', $list = 0, $code = '') public function liste_contact($statut = -1, $source = 'external', $list = 0, $code = '')
{ {
@ -2393,7 +2396,7 @@ class Ticketsup extends CommonObject
* @param string $morehtmlright More html code to show before navigation arrows * @param string $morehtmlright More html code to show before navigation arrows
* @return void * @return void
*/ */
public function ticketsup_banner_tab($paramid, $morehtml = '', $shownav = 1, $fieldid = 'id', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlright = '') public function ticketsupBannerTab($paramid, $morehtml = '', $shownav = 1, $fieldid = 'id', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlright = '')
{ {
global $conf, $form, $user, $langs; global $conf, $form, $user, $langs;

View File

@ -155,7 +155,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
$object->label .= $fuser->getNomUrl(0); $object->label .= $fuser->getNomUrl(0);
} }
$linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> '; $linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
$object->ticketsup_banner_tab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback); $object->ticketsupBannerTab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback);
dol_fiche_end(); dol_fiche_end();
print '<br>'; print '<br>';

View File

@ -133,7 +133,7 @@ if ($object->id) {
$object->label .= $fuser->getNomUrl(0); $object->label .= $fuser->getNomUrl(0);
} }
$linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> '; $linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
$object->ticketsup_banner_tab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback); $object->ticketsupBannerTab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback);
dol_fiche_end(); dol_fiche_end();

View File

@ -113,7 +113,7 @@ if ($action == 'view') {
$object->dao->label .= $fuser->getNomUrl(0); $object->dao->label .= $fuser->getNomUrl(0);
} }
$linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> '; $linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
$object->dao->ticketsup_banner_tab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback); $object->dao->ticketsupBannerTab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback);
dol_fiche_end(); dol_fiche_end();