Exemple #1
0
 /**
  *  Return message that say how many notification (and to which email) will occurs on requested event.
  *	This is to show confirmation messages before event is recorded.
  *
  * 	@param	string	$action		Id of action in llx_c_action_trigger
  * 	@param	int		$socid		Id of third party
  *  @param	Object	$object		Object the notification is about
  *	@return	string				Message
  */
 function confirmMessage($action, $socid, $object)
 {
     global $langs;
     $langs->load("mails");
     $listofnotiftodo = $this->getNotificationsArray($action, $socid, $object);
     $nb = count($listofnotiftodo);
     if ($nb <= 0) {
         $texte = img_object($langs->trans("Notifications"), 'email') . ' ' . $langs->trans("NoNotificationsWillBeSent");
     }
     if ($nb == 1) {
         $texte = img_object($langs->trans("Notifications"), 'email') . ' ' . $langs->trans("ANotificationsWillBeSent");
     }
     if ($nb >= 2) {
         $texte = img_object($langs->trans("Notifications"), 'email') . ' ' . $langs->trans("SomeNotificationsWillBeSent", $nb);
     }
     $i = 0;
     foreach ($listofnotiftodo as $key => $val) {
         if ($i) {
             $texte .= ', ';
         } else {
             $texte .= ' (';
         }
         if ($val['isemailvalid']) {
             $texte .= $val['email'];
         } else {
             $texte .= $val['emaildesc'];
         }
         $i++;
     }
     if ($i) {
         $texte .= ')';
     }
     return $texte;
 }
Exemple #2
0
    /**
     *    	\brief      Renvoie le message signalant les notifications qui auront lieu sur
     *					un evenement pour affichage dans texte de confirmation evenement.
     * 		\param		action		Id of action in llx_c_action_trigger
     * 		\param		socid		Id of third party
     *		\return		string		Message
     */
	function confirmMessage($action,$socid)
	{
		global $langs;
		$langs->load("mails");

		$nb=$this->countDefinedNotifications($action,$socid);
		if ($nb <= 0) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("NoNotificationsWillBeSent");
		if ($nb == 1) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("ANotificationsWillBeSent");
		if ($nb >= 2) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("SomeNotificationsWillBeSent",$nb);
		return $texte;
	}
    /** Overloading the doActions function : replacing the parent's function with the one below 
     *  @param      parameters  meta datas of the hook (context, etc...) 
     *  @param      object             the object you want to process (an invoice if you are in invoice module, a propale in propale's module, etc...) 
     *  @param      action             current action (if set). Generally create or edit or null 
     *  @return       void 
     */
    function printSearchForm($parameters, &$object, &$action, $hookmanager)
    {
        global $langs, $db;
        if (in_array('searchform', explode(':', $parameters['context']))) {
            $langs->load('searcheverywhere@searcheverywhere');
            $res = '';
            $res .= '<form method="post" action="' . dol_buildpath('/searcheverywhere/search.php', 1) . '">';
            $res .= '<div class="menu_titre menu_titre_search"><label for="sew_keyword"><a class="vsmenu" href="' . dol_buildpath('/searcheverywhere/search.php', 1) . '">' . img_object($langs->trans('searcheverywhere'), 'searcheverywhere@searcheverywhere') . ' ' . $langs->trans('Searcheverywhere') . '</a></label></div>';
            $res .= '	<input type="text" size="10" name="keyword" title="' . $langs->trans('Keyword') . '" class="flat" id="sew_keyword" /><input type="submit" value="' . $langs->trans('Go') . '" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px">
				</form>';
            $this->resprints = $res;
        }
        return 0;
    }
/**
 * Add area with bookmarks in menu
 *
 * @param 	DoliDb  	$aDb		Database handler
 * @param 	Translate	$aLangs		Object lang
 * @return	string
 */
function printBookmarksList($aDb, $aLangs)
{
    global $conf, $user;
    $db = $aDb;
    $langs = $aLangs;
    require_once DOL_DOCUMENT_ROOT . '/bookmarks/class/bookmark.class.php';
    if (!isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) {
        $conf->global->BOOKMARKS_SHOW_IN_MENU = 5;
    }
    $bookm = new Bookmark($db);
    $langs->load("bookmarks");
    $url = $_SERVER["PHP_SELF"] . (!empty($_SERVER["QUERY_STRING"]) ? '?' . $_SERVER["QUERY_STRING"] : '');
    $ret = '';
    // Menu bookmark
    $ret .= '<div class="menu_titre">';
    $ret .= '<table class="nobordernopadding" width="100%" summary="bookmarkstable"><tr><td>';
    $ret .= '<a class="vmenu" href="' . DOL_URL_ROOT . '/bookmarks/liste.php">' . $langs->trans('Bookmarks') . '</a>';
    $ret .= '</td><td align="right">';
    if ($user->rights->bookmark->creer) {
        $ret .= '<a class="vsmenu" href="' . DOL_URL_ROOT . '/bookmarks/fiche.php?action=create&amp;urlsource=' . urlencode($url) . '&amp;url=' . urlencode($url) . '">';
        //$ret.=img_picto($langs->trans('AddThisPageToBookmarks'),'edit_add').' ';
        $ret .= img_object($langs->trans('AddThisPageToBookmarks'), 'bookmark');
        $ret .= '</a>';
    }
    $ret .= '</td></tr></table>';
    $ret .= '</div>';
    $ret .= '<div class="menu_top"></div>' . "\n";
    // Menu with all bookmarks
    if (!empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) {
        $sql = "SELECT rowid, title, url, target FROM " . MAIN_DB_PREFIX . "bookmark";
        $sql .= " WHERE (fk_user = "******" OR fk_user is NULL OR fk_user = 0)";
        $sql .= " AND entity = " . $conf->entity;
        $sql .= " ORDER BY position";
        if ($resql = $db->query($sql)) {
            $i = 0;
            while ($i < $conf->global->BOOKMARKS_SHOW_IN_MENU && ($obj = $db->fetch_object($resql))) {
                $ret .= '<div class="menu_contenu"><a class="vsmenu" title="' . $obj->title . '" href="' . $obj->url . '"' . ($obj->target == 1 ? ' target="_blank"' : '') . '>';
                $ret .= ' ' . img_object('', 'bookmark') . ' ';
                $ret .= dol_trunc($obj->title, 20) . '</a><br></div>';
                $i++;
            }
        } else {
            dol_print_error($db);
        }
    }
    $ret .= '<div class="menu_end"></div>';
    return $ret;
}
Exemple #5
0
					$text.= ' '.$delivery->lines[$i]->ref.'</a>';
					$text.= ' - '.$delivery->lines[$i]->label;
					$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($delivery->lines[$i]->description));
					//print $description;
					print $html->textwithtooltip($text,$description,3,'','',$i);
					print_date_range($delivery->lines[$i]->date_start,$delivery->lines[$i]->date_end);
					if ($conf->global->PRODUIT_DESC_IN_FORM)
					{
						print ($delivery->lines[$i]->description && $delivery->lines[$i]->description!=$delivery->lines[$i]->label)?'<br>'.dol_htmlentitiesbr($delivery->lines[$i]->description):'';
					}
				}
				else
				{
					print "<td>";
					if ($delivery->lines[$i]->fk_product_type==1) $text = img_object($langs->trans('Service'),'service');
					else $text = img_object($langs->trans('Product'),'product');
					print $text.' '.nl2br($delivery->lines[$i]->description);
					print_date_range($objp->date_start,$objp->date_end);
					print "</td>\n";
				}

				print '<td align="center">'.$delivery->lines[$i]->qty_asked.'</td>';
				print '<td align="center">'.$delivery->lines[$i]->qty_shipped.'</td>';

				print "</tr>";

				$i++;
			}

			print "</table>\n";
?>
">

	<?php 
if ($line->fk_product > 0) {
    ?>

		<a href="<?php 
    echo DOL_URL_ROOT . '/product/card.php?id=' . $line->fk_product;
    ?>
">
		<?php 
    if ($line->product_type == 1) {
        echo img_object($langs->trans('ShowService'), 'service');
    } else {
        print img_object($langs->trans('ShowProduct'), 'product');
    }
    echo ' ' . $line->ref;
    ?>
		</a>
		<?php 
    echo ' - ' . nl2br($line->product_label);
    ?>

		<br>

	<?php 
}
?>

	<?php 
Exemple #7
0
    $i = 0;
    while ($i < min($num, $max)) {
        $objp = $db->fetch_object($resql);
        $var = !$var;
        print "<tr " . $bc[$var] . ">";
        print '<td>' . dol_print_date($db->jdate($objp->datem), 'dayhour') . '</td>';
        print "<td><a href=\"../card.php?id={$objp->rowid}\">";
        print img_object($langs->trans("ShowProduct"), "product") . ' ' . $objp->produit;
        print "</a></td>\n";
        if (!empty($conf->productbatch->enabled)) {
            print '<td>' . $objp->batch . '</td>';
            print '<td>' . dol_print_date($db->jdate($objp->eatby), 'day') . '</td>';
            print '<td>' . dol_print_date($db->jdate($objp->sellby), 'day') . '</td>';
        }
        print '<td><a href="card.php?id=' . $objp->entrepot_id . '">';
        print img_object($langs->trans("ShowWarehouse"), "stock") . ' ' . $objp->stock;
        print "</a></td>\n";
        print '<td align="right">';
        if ($objp->qty > 0) {
            print '+';
        }
        print $objp->qty . '</td>';
        print "</tr>\n";
        $i++;
    }
    $db->free($resql);
    print "</table>";
}
//print '</td></tr></table>';
print '</div></div></div>';
llxFooter();
Exemple #8
0
            $commandestatic->ref = $obj->ref;
            print '<table class="nobordernopadding"><tr class="nocellnopadd">';
            print '<td width="96" class="nobordernopadding nowrap">';
            print $commandestatic->getNomUrl(1);
            print '</td>';
            print '<td width="16" class="nobordernopadding nowrap">';
            print '&nbsp;';
            print '</td>';
            print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
            $filename = dol_sanitizeFileName($obj->ref);
            $filedir = $conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
            $urlsource = $_SERVER['PHP_SELF'] . '?id=' . $obj->rowid;
            print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
            print '</td></tr></table>';
            print '</td>';
            print '<td><a href="' . DOL_URL_ROOT . '/fourn/card.php?socid=' . $obj->socid . '">' . img_object($langs->trans("ShowCompany"), "company") . ' ' . $obj->name . '</a></td>';
            print '<td>' . dol_print_date($db->jdate($obj->tms), 'day') . '</td>';
            print '<td align="right">' . $commandestatic->LibStatut($obj->fk_statut, 5) . '</td>';
            print '</tr>';
            $i++;
        }
    }
    print "</table><br>";
} else {
    dol_print_error($db);
}
/*
 * Orders to process
*/
/*
 $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid";
Exemple #9
0
 /**
  *	Return clicable name (with picto eventually)
  *
  *	@param	int		$withpicto		0=No picto, 1=Include picto into link, 2=Only picto
  *	@param	string	$option			'withproject' or ''
  *  @param	string	$mode			Mode 'task', 'time', 'contact', 'note', document' define page to link to.
  * 	@param	int		$addlabel		0=Default, 1=Add label into string, >1=Add first chars into string
  *  @param	string	$sep			Separator between ref and label if option addlabel is set
  *	@return	string					Chaine avec URL
  */
 function getNomUrl($withpicto = 0, $option = '', $mode = 'task', $addlabel = 0, $sep = ' - ')
 {
     global $langs;
     $result = '';
     $label = '<u>' . $langs->trans("ShowTask") . '</u>';
     if (!empty($this->ref)) {
         $label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
     }
     if (!empty($this->label)) {
         $label .= '<br><b>' . $langs->trans('LabelTask') . ':</b> ' . $this->label;
     }
     if ($this->date_start || $this->date_end) {
         $label .= "<br>" . get_date_range($this->date_start, $this->date_end, '', $langs, 0);
     }
     $linkclose = '" title="' . dol_escape_htmltag($label, 1) . '" class="classfortooltip">';
     $link = '<a href="' . DOL_URL_ROOT . '/projet/tasks/' . $mode . '.php?id=' . $this->id . ($option == 'withproject' ? '&withproject=1' : '') . $linkclose;
     $linkend = '</a>';
     $picto = 'projecttask';
     if ($withpicto) {
         $result .= $link . img_object($label, $picto, 'class="classfortooltip"') . $linkend;
     }
     if ($withpicto && $withpicto != 2) {
         $result .= ' ';
     }
     if ($withpicto != 2) {
         $result .= $link . $this->ref . $linkend . ($addlabel && $this->label ? $sep . dol_trunc($this->label, $addlabel > 1 ? $addlabel : 0) : '');
     }
     return $result;
 }
Exemple #10
0
 print '<table class="noborder" width="100%">';
 print "<tr class=\"liste_titre\">";
 print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "e.label", "", "", "", $sortfield, $sortorder);
 print_liste_field_titre($langs->trans("LocationSummary"), $_SERVER["PHP_SELF"], "e.lieu", "", "", "", $sortfield, $sortorder);
 print_liste_field_titre($langs->trans("EstimatedStockValue"), $_SERVER["PHP_SELF"], "e.valo_pmp", '', '', 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans("EstimatedStockValueSell"), $_SERVER["PHP_SELF"], "", '', '', 'align="right"', $sortfield, $sortorder);
 print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "e.statut", '', '', 'align="right"', $sortfield, $sortorder);
 print "</tr>\n";
 if ($num) {
     $entrepot = new Entrepot($db);
     $total = $totalsell = 0;
     $var = false;
     while ($i < min($num, $limit)) {
         $objp = $db->fetch_object($result);
         print "<tr " . $bc[$var] . ">";
         print '<td><a href="card.php?id=' . $objp->rowid . '">' . img_object($langs->trans("ShowWarehouse"), 'stock') . ' ' . $objp->ref . '</a></td>';
         print '<td>' . $objp->lieu . '</td>';
         // PMP value
         print '<td align="right">';
         if (price2num($objp->estimatedvalue, 'MT')) {
             print price(price2num($objp->estimatedvalue, 'MT'), 1);
         } else {
             print '';
         }
         print '</td>';
         // Selling value
         print '<td align="right">';
         if (empty($conf->global->PRODUIT_MULTIPRICES)) {
             print price(price2num($objp->sellvalue, 'MT'), 1);
         } else {
             print $langs->trans("Variable");
Exemple #11
0
    /**
     *    	Return a link on thirdparty (with picto)
     *		@param		withpicto		Inclut le picto dans le lien (0=No picto, 1=Inclut le picto dans le lien, 2=Picto seul)
     *		@param		option			Sur quoi pointe le lien ('', 'customer', 'prospect', 'supplier')
     *		@param		maxlen			Max length of text
     *		@return		string			String with URL
     */
    function getNomUrl($withpicto=0,$option='',$maxlen=0)
    {
        global $conf,$langs;

        $result='';
        $lien=$lienfin='';

        if ($option == 'customer' || $option == 'compta')
        {
            if (($this->client == 1 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))  // Only customer
            {
                $lien = '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$this->id;
            }
            elseif($this->client == 2 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))   // Only prospect
            {
                $lien = '<a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$this->id;
            }
        }
        else if ($option == 'prospect' && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
        {
            $lien = '<a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$this->id;
        }
        else if ($option == 'supplier')
        {
            $lien = '<a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$this->id;
        }
        // By default
        if (empty($lien))
        {
            $lien = '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->id;
        }

        // Add type of canvas
        $lien.=(!empty($this->canvas)?'&amp;canvas='.$this->canvas:'').'">';
        $lienfin='</a>';

        $name=$this->name?$this->name:$this->nom;

        if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin);
        if ($withpicto && $withpicto != 2) $result.=' ';
        $result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin;

        return $result;
    }
Exemple #12
0
 /**
  * Return name with link
  *
  * @param int $withpicto Add image
  *
  * @return int if KO, >0 if OK
  */
 public function getNomUrl($withpicto = 0)
 {
     global $langs;
     $result = '';
     $lien = '<a href="' . dol_buildpath('lead/lead/card.php', 1) . '?id=' . $this->id . '">';
     $lienfin = '</a>';
     $picto = 'propal';
     $label = $langs->trans("LeadShowLead") . ': ' . $this->ref;
     if ($withpicto) {
         $result .= $lien . img_object($label, $picto) . $lienfin;
     }
     if ($withpicto && $withpicto != 2) {
         $result .= ' ';
     }
     $result .= $lien . $this->ref . $lienfin;
     return $result;
 }
 /**
  *    	Renvoie tags list clicable (avec eventuellement le picto)
  *
  * 		@param		int		$withpicto		0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
  * 		@param		int		$maxlen			length max libelle
  * 		@return		string					String with URL
  */
 function getTagUrl($withpicto = 0, $maxlen = 0)
 {
     global $langs;
     $result = '';
     if (count($this->Tag)) {
         for ($i = 0; $i < count($this->Tag); $i++) {
             $lien = '<a href="' . DOL_URL_ROOT . '/adherent/type.php?id=' . $this->Tag[$i] . '">';
             $lienfin = '</a> ';
             $picto = 'group';
             $label = $langs->trans("ShowTypeCard", $this->Tag[$i]);
             if ($withpicto) {
                 $result .= $lien . img_object($label, $picto) . $lienfin;
             }
             if ($withpicto && $withpicto != 2) {
                 $result .= ' ';
             }
             $result .= $lien . ($maxlen ? dol_trunc($this->Tag[$i], $maxlen) : $this->Tag[$i]) . $lienfin;
         }
     }
     return $result;
 }
Exemple #14
0
    print_liste_field_titre($langs->trans("LocationSummary"),"valo.php", "e.lieu","","","",$sortfield,$sortorder);
    print_liste_field_titre($langs->trans("EstimatedStockValue"),"valo.php", "e.valo_pmp",'','','align="right"',$sortfield,$sortorder);
    print_liste_field_titre($langs->trans("EstimatedStockValueSell"),"", "",'','','align="right"',$sortfield,$sortorder);
    print_liste_field_titre($langs->trans("Status"),"valo.php", "e.statut",'','','align="right"',$sortfield,$sortorder);
    print "</tr>\n";

    if ($num)
    {
        $entrepot=new Entrepot($db);
        $total = $totalsell = 0;
        $var=false;
        while ($i < min($num,$limit))
        {
            $objp = $db->fetch_object($result);
            print "<tr $bc[$var]>";
            print '<td><a href="fiche.php?id='.$objp->ref.'">'.img_object($langs->trans("ShowWarehouse"),'stock').' '.$objp->label.'</a></td>';
            print '<td>'.$objp->lieu.'</td>';
            // PMP value
            print '<td align="right">';
            if (price2num($objp->estimatedvalue,'MT')) print price(price2num($objp->estimatedvalue,'MT'));
            else print '';
            print '</td>';
            // Selling value
            print '<td align="right">';
            if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($objp->sellvalue,'MT'));
            else print $langs->trans("Variable");
            print '</td>';
            // Status
            print '<td align="right">'.$entrepot->LibStatut($objp->statut,5).'</td>';
            print "</tr>\n";
            $total += price2num($objp->estimatedvalue,'MU');
Exemple #15
0
			print '<table class="noborder" width="100%">';
			print '<tr class="liste_titre">';
			print '<td>'.$langs->trans("Name").'</td>';
			print '<td>'.$langs->trans("Login").'</td>';
			print '<td>&nbsp;</td>';
			print "</tr>\n";

			$var=True;

			while ($i < $num)
			{
				$obj = $db->fetch_object($resql);
				$var=!$var;
				print "<tr $bc[$var]><td>";
				print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
				print img_object($langs->trans("ShowUser"),"user").' ';
				print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n";
				print '</a>';
				print '</td><td>'.$obj->login.'</td>';
				print '<td><a href="commerciaux.php?socid='.$_GET["socid"].'&amp;commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>';

				print '</tr>'."\n";
				$i++;
			}

			print "</table>";
			$db->free($resql);
		}
		else
		{
			dol_print_error($db);
Exemple #16
0
 if ($obj->pid) {
     $productstatic->id = $obj->pid;
     $productstatic->type = $obj->ptype;
     $productstatic->ref = $obj->pref;
     $productstatic->entity = $obj->pentity;
     print $productstatic->getNomUrl(1, '', 20);
     print $obj->label ? ' - ' . dol_trunc($obj->label, 16) : '';
     if (!empty($obj->description) && !empty($conf->global->PRODUCT_DESC_IN_LIST)) {
         print '<br>' . dol_nl2br($obj->description);
     }
 } else {
     if ($obj->type == 0) {
         print img_object($obj->description, 'product') . dol_trunc($obj->description, 20);
     }
     if ($obj->type == 1) {
         print img_object($obj->description, 'service') . dol_trunc($obj->description, 20);
     }
 }
 print '</td>';
 // Third party
 print '<td>';
 $companystatic->id = $obj->socid;
 $companystatic->name = $obj->name;
 $companystatic->client = 1;
 print $companystatic->getNomUrl(1, 'customer', 28);
 print '</td>';
 // Start date
 if ($mode == "0") {
     print '<td align="center">';
     print $obj->date_ouverture_prevue ? dol_print_date($db->jdate($obj->date_ouverture_prevue)) : '&nbsp;';
     if ($db->jdate($obj->date_ouverture_prevue) && $db->jdate($obj->date_ouverture_prevue) < $now - $conf->contrat->services->inactifs->warning_delay) {
Exemple #17
0
     print ' ' . $paymentvatstatic->getNomUrl(2);
 } elseif ($links[$key]['type'] == 'payment_salary') {
     $paymentsalstatic->id = $links[$key]['url_id'];
     $paymentsalstatic->ref = $links[$key]['url_id'];
     print ' ' . $paymentsalstatic->getNomUrl(2);
 } elseif ($links[$key]['type'] == 'payment_loan') {
     print '<a href="' . DOL_URL_ROOT . '/loan/payment/card.php?id=' . $links[$key]['url_id'] . '">';
     print ' ' . img_object($langs->trans('ShowPayment'), 'payment') . ' ';
     print '</a>';
 } elseif ($links[$key]['type'] == 'payment_donation') {
     print '<a href="' . DOL_URL_ROOT . '/don/payment/card.php?id=' . $links[$key]['url_id'] . '">';
     print ' ' . img_object($langs->trans('ShowPayment'), 'payment') . ' ';
     print '</a>';
 } elseif ($links[$key]['type'] == 'payment_expensereport') {
     print '<a href="' . DOL_URL_ROOT . '/expensereport/payment/card.php?id=' . $links[$key]['url_id'] . '">';
     print ' ' . img_object($langs->trans('ShowPayment'), 'payment') . ' ';
     print '</a>';
 } elseif ($links[$key]['type'] == 'banktransfert') {
     // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
     if ($objp->amount > 0) {
         $banklinestatic->fetch($links[$key]['url_id']);
         $bankstatic->id = $banklinestatic->fk_account;
         $bankstatic->label = $banklinestatic->bank_account_label;
         print ' (' . $langs->trans("TransferFrom") . ' ';
         print $bankstatic->getNomUrl(1, 'transactions');
         print ' ' . $langs->trans("toward") . ' ';
         $bankstatic->id = $objp->bankid;
         $bankstatic->label = $objp->bankref;
         print $bankstatic->getNomUrl(1, '');
         print ')';
     } else {
Exemple #18
0
     $result = $chronodocs_static->get_list($MAXLIST, 0, "f.date_c", "DESC", $objsoc->id);
     if (is_array($result)) {
         $var = true;
         $i = 0;
         //$num = sizeOf($result);
         $num = $chronodocs_static->get_nb_chronodocs($objsoc->id);
         if ($num > 0) {
             print '<tr class="liste_titre">';
             print '<td colspan="3"><table width="100%" class="nobordernopadding"><tr><td>' . $langs->trans("LastChronodocs", $num <= $MAXLIST ? "" : $MAXLIST) . '</td><td align="right"><a href="' . DOL_URL_ROOT . '/chronodocs/index.php?socid=' . $objsoc->id . '">' . $langs->trans("AllChronodocs") . ' (' . $num . ')</td></tr></table></td>';
             print '</tr>';
         }
         while ($i < $num && $i < $MAXLIST) {
             $obj = array_shift($result);
             $var = !$var;
             print "<tr {$bc[$var]}>";
             print '<td><a href="' . DOL_URL_ROOT . '/chronodocs/fiche.php?id=' . $obj->fichid . '">' . img_object($langs->trans("ShowChronodocs"), "generic") . " " . $obj->ref . '</a></td>';
             print "<td align=\"left\">" . dol_trunc($obj->title, 30) . "</td>";
             print "<td align=\"right\">" . dol_print_date($db->jdate($obj->dp), 'day') . "</td>\n";
             print "</tr>";
             $i++;
         }
     }
     print "</table>";
 }
 print "</td></tr>";
 print "</table>";
 print "\n</div>\n";
 /*
  * Barre d'actions
  */
 print '<div class="tabsAction">';
Exemple #19
0
    $resql = $db->query($sql);
    if ($resql) {
        print '<table class="noborder" width="100%">';
        $tag = !$tag;
        print '<tr class="liste_titre">';
        print '<td width="160">' . $langs->trans("Date") . '</td>';
        print '<td width="160" align="center">' . $langs->trans("CustomerRelativeDiscountShort") . '</td>';
        print '<td align="left">' . $langs->trans("NoteReason") . '</td>';
        print '<td align="center">' . $langs->trans("User") . '</td>';
        print '</tr>';
        $i = 0;
        $num = $db->num_rows($resql);
        while ($i < $num) {
            $obj = $db->fetch_object($resql);
            $tag = !$tag;
            print '<tr ' . $bc[$tag] . '>';
            print '<td>' . dol_print_date($db->jdate($obj->dc), "dayhour") . '</td>';
            print '<td align="center">' . price2num($obj->remise_percent) . '%</td>';
            print '<td align="left">' . $obj->note . '</td>';
            print '<td align="center"><a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a></td>';
            print '</tr>';
            $i++;
        }
        $db->free($resql);
        print "</table>";
    } else {
        dol_print_error($db);
    }
}
$db->close();
llxFooter();
 }
 if ($sortfield == 'amount_ttc' && $sortorder == 'asc') {
     asort($amount);
     $arrayforsort = $amount;
 }
 if ($sortfield == 'amount_ttc' && $sortorder == 'desc') {
     arsort($amount);
     $arrayforsort = $amount;
 }
 foreach ($arrayforsort as $key => $value) {
     $var = !$var;
     print "<tr " . $bc[$var] . ">";
     // Third party
     $fullname = $name[$key];
     if ($key >= 0) {
         $linkname = '<a href="' . DOL_URL_ROOT . '/user/fiche.php?id=' . $key . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $fullname . '</a>';
     } else {
         $linkname = $langs->trans("PaymentsNotLinkedToUser");
     }
     print "<td>" . $linkname . "</td>\n";
     // Amount w/o VAT
     print '<td align="right">';
     if ($modecompta != 'CREANCES-DETTES') {
         if ($key > 0) {
             print '<a href="' . DOL_URL_ROOT . '/compta/paiement/liste.php?userid=' . $key . '">';
         } else {
             print '<a href="' . DOL_URL_ROOT . '/compta/paiement/liste.php?userid=-1">';
         }
     } else {
         if ($key > 0) {
             print '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?userid=' . $key . '">';
Exemple #21
0
	/**
	 *	Renvoie nom clicable (avec eventuellement le picto)
	 *  @param		withpicto		0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
	 *  @return		string			Chaine avec URL
 	 */
	function getNomUrl($withpicto=0,$maxlength=0)
	{
		global $langs;

		$result='';

		$lien = '<a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$this->fk_contrat.'">';
		$lienfin='</a>';

		$picto='contract';

		$label=$langs->trans("ShowContractOfService").': '.$this->label;

		if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
		if ($withpicto && $withpicto != 2) $result.=' ';
		if ($withpicto != 2) $result.=$lien.$this->label.$lienfin;
		return $result;
	}
Exemple #22
0
     $var = !$var;
     print "<tr " . $bc[$var] . ">";
     // Num ref cheque
     print '<td width="80">';
     $checkdepositstatic->id = $objp->rowid;
     $checkdepositstatic->ref = $objp->ref ? $objp->ref : $objp->rowid;
     $checkdepositstatic->statut = $objp->statut;
     print $checkdepositstatic->getNomUrl(1);
     print '</td>';
     // Date
     print '<td align="center">' . dol_print_date($db->jdate($objp->dp), 'day') . '</td>';
     // TODO Use date hour
     // Bank
     print '<td>';
     if ($objp->bid) {
         print '<a href="' . DOL_URL_ROOT . '/compta/bank/account.php?account=' . $objp->bid . '">' . img_object($langs->trans("ShowAccount"), 'account') . ' ' . $objp->label . '</a>';
     } else {
         print '&nbsp;';
     }
     print '</td>';
     // Number of cheques
     print '<td align="right">' . $objp->nbcheque . '</td>';
     // Amount
     print '<td align="right">' . price($objp->amount) . '</td>';
     // Statut
     print '<td align="right">';
     print $checkdepositstatic->LibStatut($objp->statut, 5);
     print "</td></tr>\n";
     $i++;
 }
 print "</table>";
Exemple #23
0
     if ($caneditperms) {
         print '<tr ' . $bc[$var] . '>';
         print '<td class="nowrap">' . img_object('', $picto) . ' ' . $objMod->getName();
         print '<a name="' . $objMod->getName() . '">&nbsp;</a></td>';
         print '<td align="center" class="nowrap">';
         print '<a title=' . $langs->trans("All") . ' alt=' . $langs->trans("All") . ' href="perms.php?id=' . $fgroup->id . '&amp;action=addrights&amp;module=' . $obj->module . '#' . $objMod->getName() . '">' . $langs->trans("All") . "</a>";
         print '/';
         print '<a title=' . $langs->trans("None") . ' alt=' . $langs->trans("None") . ' href="perms.php?id=' . $fgroup->id . '&amp;action=delrights&amp;module=' . $obj->module . '#' . $objMod->getName() . '">' . $langs->trans("None") . "</a>";
         print '</td>';
         print '<td colspan="2">&nbsp;</td>';
         print '</tr>';
     }
 }
 print '<tr ' . $bc[$var] . '>';
 // Module
 print '<td class="nowrap">' . img_object('', $picto) . ' ' . $objMod->getName() . '</td>';
 if (in_array($obj->id, $permsgroup)) {
     // Own permission by group
     if ($caneditperms) {
         print '<td align="center"><a href="perms.php?id=' . $fgroup->id . '&amp;action=delrights&amp;rights=' . $obj->id . '#' . $objMod->getName() . '">' . img_edit_remove($langs->trans("Remove")) . '</a></td>';
     }
     print '<td align="center">';
     print img_picto($langs->trans("Active"), 'tick');
     print '</td>';
 } else {
     // Do not own permission
     if ($caneditperms) {
         print '<td align="center"><a href="perms.php?id=' . $fgroup->id . '&amp;action=addrights&amp;rights=' . $obj->id . '#' . $objMod->getName() . '">' . img_edit_add($langs->trans("Add")) . '</a></td>';
     }
     print '<td>&nbsp</td>';
 }
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;

$langs->load("contracts");
echo '<br />';
print_titre($langs->trans('RelatedContracts'));
?>
<table class="noborder" width="100%">
<tr class="liste_titre">
	<td><?php echo $langs->trans("Ref"); ?></td>
	<td align="center"><?php echo $langs->trans("Date"); ?></td>
	<td align="right">&nbsp;</td>
	<td align="right"><?php echo $langs->trans("Status"); ?></td>
</tr>
<?php
$var=true;
foreach($linkedObjectBlock as $object)
{
    $object->fetch_lines();
	$var=!$var;
?>
<tr <?php echo $bc[$var]; ?> ><td>
	<a href="<?php echo DOL_URL_ROOT.'/contrat/fiche.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowContract"),"contract").' '.$object->ref; ?></a></td>
	<td align="center"><?php echo dol_print_date($object->date_contrat,'day'); ?></td>
	<td align="right">&nbsp;</td>
	<td align="right"><?php echo $object->getLibStatut(6); ?></td>
</tr>
<?php } ?>

</table>

<!-- END PHP TEMPLATE -->
Exemple #25
0
print '</td></tr>';
print '</table>';
print '</td><td class="notopnoleftnoright" valign="top">';
$var = true;
// Summary of members by type
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("MembersTypes") . '</td>';
foreach ($staticmember->fk_extrafields->fields->Status->values as $aRow) {
    print '<td align=right>' . $langs->trans($aRow->label) . '</td>';
}
print "</tr>\n";
foreach ($AdherentType as $key => $adhtype) {
    $var = !$var;
    print "<tr {$bc[$var]}>";
    print '<td><a href="adherent/type.php?id=' . $key . '">' . img_object($langs->trans("ShowType"), "group") . ' ' . $key . '</a></td>';
    foreach ($staticmember->fk_extrafields->fields->Status->values as $idx => $row) {
        if ($Adherents[$key][$idx]) {
            print '<td align="right">' . $Adherents[$key][$idx] . ' ' . $staticmember->LibStatus($idx) . '</td>';
        } else {
            print '<td></td>';
        }
    }
    print "</tr>\n";
}
print '<tr class="liste_total">';
print '<td class="liste_total">' . $langs->trans("Total") . '</td>';
foreach ($staticmember->fk_extrafields->fields->Status->values as $idx => $row) {
    if ($somme[$idx]) {
        print '<td class="liste_total" align="right">' . $somme[$idx] . ' ' . $staticmember->LibStatus($idx) . '</td>';
    } else {
 /**
  *  Renvoie nom clicable (avec eventuellement le picto)
  *
  *	@param	int		$withpicto		0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
  *	@return	string					Chaine avec URL
  */
 function getNomUrl($withpicto = 0)
 {
     global $langs;
     $result = '';
     $lien = '<a href="' . DOL_URL_ROOT . '/adherents/fiche_subscription.php?rowid=' . $this->id . '">';
     $lienfin = '</a>';
     $picto = 'payment';
     $label = $langs->trans("ShowSubscription");
     if ($withpicto) {
         $result .= $lien . img_object($label, $picto) . $lienfin;
     }
     if ($withpicto && $withpicto != 2) {
         $result .= ' ';
     }
     $result .= $lien . $this->ref . $lienfin;
     return $result;
 }
                                $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
                                $htmltooltip .= '<br>' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
                                $htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1);
                                $htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1);
                                //$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
                                //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
                                $htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
                                print '<td align="center">';
                                print $form->textwithpicto('', $htmltooltip, 1, 0);
                                print '</td>';
                                // Preview
                                print '<td align="center">';
                                if ($module->type == 'pdf') {
                                    print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'bill') . '</a>';
                                } else {
                                    print img_object($langs->trans("PreviewNotAvailable"), 'generic');
                                }
                                print '</td>';
                                print "</tr>\n";
                            }
                        }
                    }
                }
            }
        }
    }
}
print '</table>';
print "<br>";
/*
 * Other options
Exemple #28
0
 $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid';
 $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid';
 $sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';
 $sql .= ' ORDER BY p.datep, p.tms';
 $result = $db->query($sql);
 if ($result) {
     $num = $db->num_rows($result);
     $i = 0;
     // if ($object->type != 2)
     // {
     if ($num > 0) {
         while ($i < $num) {
             $objp = $db->fetch_object($result);
             $var = !$var;
             print '<tr ' . $bc[$var] . '><td>';
             print '<a href="' . DOL_URL_ROOT . '/compta/paiement/card.php?id=' . $objp->rowid . '">' . img_object($langs->trans('ShowPayment'), 'payment') . ' ';
             print dol_print_date($db->jdate($objp->dp), 'day') . '</a></td>';
             $label = $langs->trans("PaymentType" . $objp->payment_code) != "PaymentType" . $objp->payment_code ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label;
             print '<td>' . $label . ' ' . $objp->num_paiement . '</td>';
             if (!empty($conf->banque->enabled)) {
                 $bankaccountstatic->id = $objp->baid;
                 $bankaccountstatic->ref = $objp->ref;
                 $bankaccountstatic->label = $objp->ref;
                 print '<td align="right">';
                 if ($bankaccountstatic->id) {
                     print $bankaccountstatic->getNomUrl(1, 'transactions');
                 }
                 print '</td>';
             }
             print '<td align="right">' . price($sign * $objp->amount) . '</td>';
             print '<td>&nbsp;</td>';
Exemple #29
0
        echo $_SESSION['newtoken'];
        ?>
" />
	<input type="hidden" name="id" value="<?php 
        echo $object->id;
        ?>
" />
	<input type="hidden" name="action" value="addcontact" />
	<input type="hidden" name="source" value="external" />
	<?php 
        if ($withproject) {
            print '<input type="hidden" name="withproject" value="' . $withproject . '">';
        }
        ?>
		<div class="tagtd nowrap"><?php 
        echo img_object('', 'contact') . ' ' . $langs->trans("ThirdPartyContacts");
        ?>
</div>
		<div class="tagtd nowrap maxwidthonsmartphone">
			<?php 
        $selectedCompany = isset($_GET["newcompany"]) ? $_GET["newcompany"] : $object->socid;
        ?>
			<?php 
        // add company icon for direct link
        if ($selectedCompany) {
            $companystatic->fetch($selectedCompany);
            echo $companystatic->getNomUrl(2);
        }
        ?>
			<?php 
        $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0);
Exemple #30
0
 $resql = $db->query($sql);
 if ($resql) {
     $colspan = 2;
     if (!empty($conf->multicompany->enabled)) {
         $colspan++;
     }
     $num = $db->num_rows($resql);
     print '<table class="noborder" width="100%">';
     print '<tr class="liste_titre"><td colspan="' . $colspan . '">' . $langs->trans("LastGroupsCreated", $num ? $num : $max) . '</td></tr>';
     $var = true;
     $i = 0;
     while ($i < $num && (!$max || $i < $max)) {
         $obj = $db->fetch_object($resql);
         $var = !$var;
         print "<tr " . $bc[$var] . ">";
         print '<td><a href="' . DOL_URL_ROOT . '/user/group/card.php?id=' . $obj->rowid . '">' . img_object($langs->trans("ShowGroup"), "group") . ' ' . $obj->name . '</a>';
         if (!$obj->entity) {
             print img_picto($langs->trans("GlobalGroup"), 'redstar');
         }
         print "</td>";
         if (!empty($conf->multicompany->enabled) && is_object($mc)) {
             $mc->getInfo($obj->entity);
             print '<td>';
             print $mc->label;
             print '</td>';
         }
         print '<td class="nowrap" align="right">' . dol_print_date($db->jdate($obj->datec), 'dayhour') . '</td>';
         print "</tr>";
         $i++;
     }
     print "</table><br>";